Top "Array-broadcasting" questions

Broadcasting (or singleton expansion) applies a function element-wise across one or more multidimensional arrays, matching shapes of the arguments by repeating missing or singleton dimensions.

Can't use /= on numpy array

On a numpy array, why is it I can successfully use / 2: >>> a=np.array([2, 4, 6]) >>> …

python arrays numpy array-broadcasting
How does pytorch broadcasting work?

torch.add(torch.ones(4,1), torch.randn(4)) produces a Tensor with size: torch.Size([4,4]). Can someone provide a logic behind this?

python numpy linear-algebra pytorch array-broadcasting
Finding max /min value of individual columns

I am a beginner to Data Analysis using Python and stuck on the following: I want to find maximum value …

python pandas array-broadcasting
Numpy: assignment destination is read-only - broadcast

I start with a 2D array and want to broadcast it to a 3D array (eg. from greyscale image to …

python numpy array-broadcasting
Calculate Distances Between One Point in Matrix From All Other Points

I am new to Python and I need to implement a clustering algorithm. For that, I will need to calculate …

python python-2.7 python-3.x numpy array-broadcasting
Numpy 3d array indexing

I have a 3d numpy array (n_samples x num_components x 2) in the example below n_samples = 5 and num_…

python arrays numpy matrix-indexing array-broadcasting
pandas apply typeError: 'float' object is not subscriptable

I have a dataframe df_tr like this: item_id target target_sum target_count 0 0 0 1 50 1 0 0 1 50 I'm trying to find the …

python pandas apply series array-broadcasting