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.

How to add a new row to an empty numpy array

Using standard Python arrays, I can do the following: arr = [] arr.append([1,2,3]) arr.append([4,5,6]) # arr is now [[1,2,3],[4,5,6]] However, I cannot …

python numpy scipy
Numpy matrix to array

I am using numpy. I have a matrix with 1 column and N rows and I want to get an array …

python arrays matrix numpy
List of lists into numpy array

How do I convert a simple list of lists into a numpy array? The rows are individual sublists and each …

python list numpy
Windows Scipy Install: No Lapack/Blas Resources Found

I am trying to install python and a series of packages onto a 64bit windows 7 desktop. I have installed Python 3.4, …

python windows python-3.x numpy pip
A tool to convert MATLAB code to Python

I have a bunch of MATLAB code from my MS thesis which I now want to convert to Python (using …

python matlab numpy matplotlib scipy
How to get correlation of two vectors in python

In matlab I use a=[1,4,6] b=[1,2,3] corr(a,b) which returns .9934. I've tried numpy.correlate but it returns something completely …

python numpy
Converting numpy dtypes to native python types

If I have a numpy dtype, how do I automatically convert it to its closest python data type? For example, …

python numpy
surface plots in matplotlib

I have a list of 3-tuples representing a set of points in 3D space. I want to plot a surface …

python numpy matplotlib surface
How to implement the Softmax function in Python

From the Udacity's deep learning class, the softmax of y_i is simply the exponential divided by the sum of …

python numpy machine-learning logistic-regression softmax
How to get element-wise matrix multiplication (Hadamard product) in numpy?

I have two matrices a = np.matrix([[1,2], [3,4]]) b = np.matrix([[5,6], [7,8]]) and I want to get the element-wise product, [[1*5,2*6], [3*7,4*8]], equaling [[5,12], [21,32]] I …

python numpy matrix matrix-multiplication elementwise-operations