Top "Vectorization" questions

Vectorization refers to a programming paradigm where functions operate on whole arrays in one go.

Vectorized look-up of values in Pandas dataframe

I have two pandas dataframes one called 'orders' and another one called 'daily_prices'. daily_prices is as follows: AAPL …

python pandas numpy vectorization
Vectorization of logistic regression cost

I have this code for the cost in logistic regression, in matlab: function [J, grad] = costFunction(theta, X, y) m = …

matlab vectorization logistic-regression
"Reduce" function for Series

Is there an analog for reduce for a pandas Series? For example, the analog for map is pd.Series.apply, …

python performance pandas vectorization reduce
MATLAB: Create a block diagonal matrix with same repeating block

I have a matrix K of dimensions n x n. I want to create a new block diagonal matrix M …

matlab matrix vectorization
Why is vectorization, faster in general, than loops?

Why, at the lowest level of the hardware performing operations and the general underlying operations involved (i.e.: things general …

performance language-agnostic vectorization simd low-level
Pandas: add timedelta column to datetime column (vectorized)

I have a pandas dataframe with two columns, a date column and an int column, and I'd simply like to …

pandas vectorization timedelta
MATLAB: How to vector-multiply two arrays of matrices?

I have two 3-dimensional arrays, the first two dimensions of which represent matrices and the last one counts through a …

arrays matlab matrix vectorization matrix-multiplication
How to vectorize my loop with g++?

The introductory links I found while searching: 6.59.14 Loop-Specific Pragmas 2.100 Pragma Loop_Optimize How to give hint to gcc about loop …

c++ optimization g++ vectorization loop-unrolling
How to calculate Euclidean length of a matrix without loops?

It seems like the answer to this should be simple, but I am stumped. I have a matrix of Nx3 …

matlab distance norm euclidean-distance vectorization
Are for-loops in pandas really bad? When should I care?

Are for loops really "bad"? If not, in what situation(s) would they be better than using a more conventional "…

python pandas iteration vectorization list-comprehension