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 convert a PIL Image into a numpy array?

Alright, I'm toying around with converting a PIL image object back and forth to a numpy array so I can …

python image numpy python-imaging-library numpy-ndarray
Numpy - add row to array

How does one add rows to a numpy array? I have an array A: A = array([[0, 1, 2], [0, 2, 0]]) I wish to add …

python arrays numpy rows
Converting between datetime, Timestamp and datetime64

How do I convert a numpy.datetime64 object to a datetime.datetime (or Timestamp)? In the following code, I create …

python datetime numpy pandas
Most efficient way to reverse a numpy array

Believe it or not, after profiling my current code, the repetitive operation of numpy array reversion ate a giant chunk …

python numpy
How do I get indices of N maximum values in a NumPy array?

NumPy proposes a way to get the index of the maximum value of an array via np.argmax. I would …

python numpy max numpy-ndarray
How to pretty-print a numpy.array without scientific notation and with given precision?

I'm curious, whether there is any way to print formatted numpy.arrays, e.g., in a way similar to this: …

python numpy python-2.x pretty-print
Removing nan values from an array

I want to figure out how to remove nan values from my array. My array looks something like this: x = [1400, 1500, 1600, …

python arrays numpy nan
Transposing a NumPy array

I use Python and NumPy and have some problems with "transpose": import numpy as np a = np.array([5,4]) print(a) …

python numpy transpose
Convert a tensor to numpy array in Tensorflow?

How to convert a tensor into a numpy array when using Tensorflow with Python bindings?

python numpy tensorflow
Comparing two NumPy arrays for equality, element-wise

What is the simplest way to compare two NumPy arrays for equality (where equality is defined as: A = B iff …

python arrays numpy elementwise-operations