Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
89 views

i would like to create a nested list of arbitrary depth (containing numerical values specifically) with uniform arbitrary lengths at each level and then compress it to a NumPy array of minimum ...
L8t Original's user avatar
0 votes
0 answers
37 views

I have an array img_data of shape (x, x, n_channels) and I want to convolve / smooth along the axis=2. Specifically, I would like the output shape to be (x,x,n_channels//3), after convolving the ...
Anks_Eagle's user avatar
0 votes
1 answer
69 views

I've initialized a list of arrays of different dimensions in Python and want to write to the entries of the arrays. If I want to write to the entry list[i, m1, m1, ..., m1, m2, m2, ..., m2] where m1 ...
serene's user avatar
  • 13
1 vote
0 answers
90 views

I am using the xarray library and I have some doubts/questions. I have this dataset:: ds <xarray.Dataset> Size: 2GB Dimensions: (Latitude: 364, Longitude: 246, Lon_u: 247, Lat_v: 364, ...
ChesuCR's user avatar
  • 9,752
0 votes
0 answers
50 views

I have a nested list on which I want to perform merging under certain restrictions. This is my nested list: [[[0.0, 2.0], [6.0, 20.0]], [[0.0, 5.0], [6.0, 12.0]], [[2.0, 5.0], [20.0, 12.0]...
Jordi van Selm's user avatar
3 votes
2 answers
92 views

I need to add two 2D numpy arrays of possibly different shapes and different corresponding axes arrays. What I mean is this: Lets define two different sets of x- and y-axes, and calculate the z-values ...
Douglas's user avatar
  • 376
2 votes
3 answers
316 views

I want to generate a twodimensional array in Python and I would like to iterate through each element and take an average. An element i should be averaged using the 8 surrounding array elements (...
s28's user avatar
  • 187
2 votes
3 answers
79 views

I want to append different dictionaries having the key as the meal_name and having total_calories and total_protein as a tuple being the value of the dictionary without overwriting the original ...
Mohammad Abdullah's user avatar
0 votes
2 answers
109 views

Can someone please help me find fault in my code? If I create a blank 2D matrix with static initial value, it returns the correct transposed matrix. Whereas if I create a blank matrix using a for loop,...
Suyash Nachankar's user avatar
0 votes
0 answers
76 views

I am working with a 2D dataset with the x and y dimensions representing two separate variables, and the combined 2D grid representing a third variable. Here's a visual example of the dataset and the x ...
bashful_creature's user avatar
2 votes
0 answers
56 views

I have 3D volumetric MRI scans representing a time series. So the sequence of these 3D volumes presents a video composed of voxels rather than the conventional 2D pixels from traditional 2D videos. ...
Jeff Boker's user avatar
2 votes
0 answers
27 views

I have a scatter-plot with the code shown below. import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np x = np.random.rand(100) y = np.random.rand(100) z = np....
cerv21's user avatar
  • 443
0 votes
1 answer
24 views

I'm trying to create a pandas DataFrame from a dictionary. We know that to do so, all the dictionary elements must be of the same dimension. The dictionary is composed of two ndarrays; one with the ...
PW14's user avatar
  • 37
0 votes
0 answers
23 views

Getting the below error while executing the code for the ravdess dataset /usr/local/lib/python3.10/dist-packages/librosa/core/spectrum.py:266: UserWarning: n_fft=2048 is too large for input signal of ...
Yash489's user avatar
0 votes
4 answers
125 views

def calculate_total_sum(arr): # Your code here sum=0 for i in range(len(arr)): for j in range(len(arr[i])): sum=sum+arr[i][j] print(sum) list1=[int(x) for x in ...
ptk-ankit's user avatar
0 votes
1 answer
64 views

so I am trying to create a heatmap plot for x, y data that are shaped as following: xs, ys, corrs = [], [], [] for x in np.linspace(0.1,5,25): xs.append(x) for y in np.linspace(0.01,x,25): ...
Roberto Corral's user avatar
-1 votes
1 answer
240 views

I am trying to understand Numpy Broadcasting. So I want to understand why is the below code working? a = np.arange(4).reshape(2,2) b = np.arange(6).reshape(3,2) a = a[:, np.newaxis] a + b I mean if ...
user3851878's user avatar
0 votes
1 answer
84 views

I created a very large 3D numpy array called tr_mat. The shape of tr_mat is: tr_mat.shape (1024, 536, 21073) Info on the 3D numpy array: First and before going into the actual code, I would like to ...
Philipp's user avatar
  • 415
0 votes
1 answer
77 views

I am trying to compute the following function: geo-decay-function: in numpy, has to be vectorized. The catch in this case is that it should work for multidimensional inputs. E.g., x having dimensions ...
rutkov's user avatar
  • 1
3 votes
2 answers
190 views

I have to work with the learning history of a Keras model. This is a basic task, but I've measured the performance of the Python built-in min() function, the numpy.min() function, and the numpy ...
Ivan's user avatar
  • 33
0 votes
1 answer
158 views

I have a numpy array of shape (260,311, 260) of points. It represents 8 electrodes (value 1) in an empty space (surrounded by zeroes). How can I detect these blobs and individualize them one by one? (...
Petru Isan's user avatar
0 votes
1 answer
69 views

I am trying to achieve a conversion of some JSON data to CSV for a later analysis. Issue is due to the n-nested levels, I think, and mainly for the last stage of the conversion process. So far, I have ...
Andrew Smith's user avatar
1 vote
1 answer
76 views

I have a two-dimensional array A, and another two-dimensional array I where each row corresponds to a set of indices with which I want to extract symmetric two-dimensional subarrays from A. I want to ...
1809's user avatar
  • 45
0 votes
1 answer
79 views

I have two 2d list with over 200 rows. I would like to find match in df1 and df2 in each sub-list and return non-matching and matching values only if the values match in df1,df2. Here a short example ...
user avatar
1 vote
1 answer
89 views

I have a large 2d list that has duplicates in some sublists. I would like to return 2 or more duplicates and return the duplicates first if impossible. For instance, Df =[[2,3,5,20],[5,10,20,10],[4,...
user avatar

1
2 3 4 5
75