I am trying to import UMAP library in my lab work, however I get an error ImportError: Numba needs NumPy 1.20 or less. Before running the code, I checked that b
I have wrote the following code: import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 5, 100) y = x**2 plt.plot(x, y) plt.xlabel("X-axis") plt
I try combine haar cascade code with histogram code I try this code : import cv2 import numpy as np from matplotlib import pyplot as plt #Cascade jeruk jeru
If I try x = np.append(x, (2,3)) the tuple (2,3) does not get appended to the end of the array, rather 2 and 3 get appended individually, even if I originall
I am intending to skip some histograms of an image in the extreme points of the distribution of any gray image. The extreme points to the left are represented b
I get the following UserWarning when trying to cache results using joblib: from tempfile import mkdtemp cachedir = mkdtemp() from joblib import Memory memory =
I'm new to the world of opencv and few days ago I tried to install it. I installed everything and moved the cv2 file from opencv to python 2.7. I tired oving bo
I cannot figure out the following problem: Elements that were placed at the corners of an 4X3 array are selected. The row indices of the selected items are [0
I want to calculate the Determinant of a Singular Matrix (which has a 0 determinant) with Numpy and when I print the determinant it shows a really small number
If we want to search for the optimal parameters theta for a linear regression model by using the normal equation with: theta = inv(X^T * X) * X^T * y one step
For some rectangular we can select all indices in a 2D array very efficiently: arr[y:y+height, x:x+width] ...where (x, y) is the upper-left corner of the rec
Let a = np.array([1, 1, 1,1,1,1]) b = np.array([2,2,2]) be two numpy arrays. Then let c = [a]+[b]+[b] clearly, c has duplicated elements b. Now I wish to
Launching pyspark in client mode. bin/pyspark --master yarn-client --num-executors 60 The import numpy on the shell goes fine but it fails in the kmeans. Someho
I have an array and want to find the average between 2 numbers and add an additional element between the 2 numbers. For example, if I start with x = np.array([1
I'm trying to create a convolution kernel, and the middle is going to be 1.5. Unfortunately I keep running in to ideas on how to do that. I'm trying to create s
x = np.arange(0,2,0.5) valeur = 2*x if valeur <= 0.6: print ("this works") else: print ("valeur is too high") here is the error I get: if vale
I'm trying to generate a sine wave of a given frequency for a given duration and then write it into a .wav file. I'm using numpy's sin function and scipy's wavf
I have this kind of dataframe, and I'm looking to get for each row the last column name equals to 1 Here is an example of my dataframe col1 col2
I currently have a numpy array or RBG tuples that I want to convert to a PIL image and save. Currently I'm doing the following: final = Image.fromarray(im_arr,
The gaussian_kde function in scipy.stats has a function evaluate that can returns the value of the PDF of an input point. I'm trying to use gaussian_kde to esti