Skip to main content

Question list filters

Filter by
Sorted by
Tagged with
Score of 0
1 answer
133 views

I'm trying to make a bar chart showing pinned/unpinned vortices depending on tilt. Because of this, I want each bar to represent one vortex, and the y-axis to be the tilt. Currently I have this code, ...
Score of -11
0 answers
364 views

why i cannot see colors changes? is this problem in matplotlib ? i try to change it PIL.Image but same problem l_path = ".png" img = imageio.imread(l_path) #plt.imshow(img, cmap="gray&...
Score of -5
1 answer
511 views

I am evaluating a biometric verification system using standard similarity match scores for genuine and impostor comparison distributions. I need to compute the operational decision threshold ...
Score of -4
3 answers
455 views

I have an array of potential substrings and an array of full strings. I'd like to know which elements of the potential substrings are indeed found as substrings in the full array. import numpy as np ...
Score of -6
0 answers
90 views

This is my dataset: data_usage = np.array([ [1.2, 0.8, 1.5, 2.0, 1.1, 3.5, 2.8], # Student A [2.0, 1.9, 2.2, 1.8, 2.5, 4.0, 3.6], # Student B [0.5, 0.6, 0.4, 0.7, 0.5, 1.2, 1.0], # ...
Score of 3
2 answers
215 views

I'd like to compute the gradient of a DataFrame, for which I can gather that the best method is to use .apply(), e.g: d = pd.DataFrame([[1,2,3],[4,5,6],[7,8,9]]) g = d.apply(np.gradient) print(g) ...
Score of 2
1 answer
171 views

Let's say I have a conditional calculation like this import numpy as np def foo(a, b, c): if a <= 0 or c == 0: return foo_special(a, b, c) return foo_normal(a, b, c) def ...
Score of 1
2 answers
197 views

In a dataset that contains X and Y coordinates, I want to assign a value in a new column based on the (X,Y) pair in a given row. Imagine a data set that contains the red points shown in the image ...
Score of 1
2 answers
190 views

I am working with huge matrix of small numbers using numpy and getting the following error: MemoryError: Unable to allocate 9.72 TiB for an array with shape (3268760, 3268760) )data type uint8" ...
Score of 2
2 answers
319 views

I'm trying to change a pixel to red. However, when I run the code, the pixel remains unedited. Can you help? import cv2 as cv import os import matplotlib.pyplot as plt def readAndWriteImage(): ...
Score of 2
1 answer
201 views

I have large matrices that contain both real numbers and nan. I want to find the most efficient way to determine if a matrix contains only zeros and/or nan entries. If it does, the code should return ...
Score of 2
0 answers
376 views

Consider import numpy as np N = 2000 a = np.ones((N, 5*N), dtype=np.float64, order="C") for _ in range(1000): x = np.array2string(a[0], threshold=np.inf) and import numpy as np N = ...
Score of 3
1 answer
161 views

I am running into an issue where my dictionary is not picking up full strings attached to variables, but instead just the first letter. import numpy as np import random trials = 5 d = {'trial': np....
Score of 4
2 answers
207 views

I want to show the distribution of angle estimations using a boxplot. The problem is that angles wrap around (I chose +-180° as the wrapping point, but the same applies to 0/360°). Matplotlibs boxplot ...
Score of -2
0 answers
175 views

I want some straightforward way to model a for all values of the array like in a for loop. the only way I found was using filtered arrays which is very very tedious. This function takes a number turns ...

15 30 50 per page
1
2 3 4 5
…
7681