Top "Numpy-ndarray" questions

Numpy Ndarray refers to the N-dimensional array type that describes the collection of the same type in the Python library NumPy.

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
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
Concatenating two one-dimensional NumPy arrays

I have two simple one-dimensional arrays in NumPy. I should be able to concatenate them using numpy.concatenate. But I …

python arrays numpy concatenation numpy-ndarray
What does -1 mean in numpy reshape?

A numpy matrix can be reshaped into a vector using reshape function with parameter -1. But I don't know what …

python numpy reshape numpy-ndarray
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
How to create a numpy array of all True or all False?

In Python, how do I create a numpy array of arbitrary shape filled with all True or all False?

python arrays numpy boolean numpy-ndarray
Convert array of indices to 1-hot encoded numpy array

Let's say I have a 1d numpy array a = array([1,0,3]) I would like to encode this as a 2D one-hot …

python numpy machine-learning numpy-ndarray one-hot-encoding
What are the advantages of NumPy over regular Python lists?

What are the advantages of NumPy over regular Python lists? I have approximately 100 financial markets series, and I am going …

python arrays list numpy numpy-ndarray
What is the purpose of meshgrid in Python / NumPy?

Can someone explain to me what is the purpose of meshgrid function in Numpy? I know it creates some kind …

python numpy multidimensional-array mesh numpy-ndarray
How does numpy.newaxis work and when to use it?

When I try numpy.newaxis the result gives me a 2-d plot frame with x-axis from 0 to 1. However, when I …

python numpy multidimensional-array array-broadcasting numpy-ndarray