Top "Numpy" questions

NumPy is an extension of the Python language that adds support to large multidimensional arrays and matrixes, along with a large library of high-level mathematical functions for operations with these arrays.

Add single element to array in numpy

I have a numpy array containing: [1, 2, 3] I want to create an array containing: [1, 2, 3, 1] That is, I want to add the …

python arrays numpy
Plotting a fast Fourier transform in Python

I have access to NumPy and SciPy and want to create a simple FFT of a data set. I have …

python numpy scipy fft
Convert a 1D array to a 2D array in numpy

I want to convert a 1-dimensional array into a 2-dimensional array by specifying the number of columns in the 2D …

python arrays matrix numpy multidimensional-array
From ND to 1D arrays

Say I have an array a: a = np.array([[1,2,3], [4,5,6]]) array([[1, 2, 3], [4, 5, 6]]) I would like to convert it to a 1D array (…

python numpy
How do I calculate percentiles with python/numpy?

Is there a convenient way to calculate percentiles for a sequence or single-dimensional numpy array? I am looking for something …

python numpy statistics numpy-ndarray percentile
ImportError: numpy.core.multiarray failed to import

I'm trying to run this program import cv2 import time cv.NamedWindow("camera", 1) capture = cv.CaptureFromCAM(0) while True: img = cv.…

python python-2.7 numpy opencv
numpy array TypeError: only integer scalar arrays can be converted to a scalar index

i=np.arange(1,4,dtype=np.int) a=np.arange(9).reshape(3,3) and a >>>array([[0, 1, 2], [3, 4, 5], [6, 7, 8]]) a[:,0:1] >>>…

python numpy indexing vectorization
Extracting specific columns in numpy array

This is an easy question but say I have an MxN matrix. All I want to do is extract specific …

python syntax numpy
How to normalize a NumPy array to within a certain range?

After doing some processing on an audio or image array, it needs to be normalized within a range before it …

python arrays numpy scipy convenience-methods
dropping infinite values from dataframes in pandas?

what is the quickest/simplest way to drop nan and inf/-inf values from a pandas DataFrame without resetting mode.…

python numpy scipy pandas