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.

Convert pandas dataframe to NumPy array

I am interested in knowing how to convert a pandas dataframe into a NumPy array. dataframe: import numpy as np …

python arrays pandas numpy dataframe
How do I create an empty array/matrix in NumPy?

I can't figure out how to use an array or matrix in the way that I would normally use a …

python arrays numpy
ValueError: setting an array element with a sequence

This Python code: import numpy as p def firstfunction(): UnFilteredDuringExSummaryOfMeansArray = [] MeanOutputHeader=['TestID','ConditionName','FilterType','RRMean','HRMean', 'dZdtMaxVoltageMean','BZMean','ZXMean','LVETMean',…

python arrays numpy slice
Creating a Pandas DataFrame from a Numpy array: How do I specify the index column and column headers?

I have a Numpy array consisting of a list of lists, representing a two-dimensional array with row labels and column …

python pandas numpy
How can the Euclidean distance be calculated with NumPy?

I have two points in 3D: (xa, ya, za) (xb, yb, zb) And I want to calculate the distance: dist = …

python numpy euclidean-distance
Import Error: No module named numpy

I have a very similar question to this question, but still one step behind. I have only one version of …

python python-3.x numpy import scipy
Numpy array dimensions

I'm currently trying to learn Numpy and Python. Given the following array: import numpy as np a = np.array([[1,2],[1,2]]) Is …

python arrays numpy dimensions
How to access the ith column of a NumPy multidimensional array?

Suppose I have: test = numpy.array([[1, 2], [3, 4], [5, 6]]) test[i] gets me ith line of the array (eg [1, 2]). How can I access …

python arrays numpy
How do I read CSV data into a record array in NumPy?

I wonder if there is a direct way to import the contents of a CSV file into a record array, …

python numpy scipy genfromtxt
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I just discovered a logical bug in my code which was causing all sorts of problems. I was inadvertently doing …

python numpy