You are on page 1of 1

Q 2: Di erence between numpy array and python list ?

Ans- Numpy is the core library for scien c compu ng in Python. It provides a
high-performance mul dimensional array object, and tools for working with
these arrays. A numpy array is a grid of values, all of the same type, and is
indexed by a tuple of nonnega ve integers. The number of dimensions is the
rank of the array; the shape of an array is a tuple of integers giving the size of
the array along each dimension numpy array is a grid of values, all of the same
type, and is indexed by a tuple of nonnega ve integers. A list is the Python
equivalent of an array, but is resizeable and can contain elements of di erent
types.
The Python core library provided Lists. A list is the Python equivalent of an
array, but is resizable and can contain elements of di erent types.
A common beginner ques on is what is the real di erence here. The answer is
performance. NumPy data structures perform be er in:
• Size - NumPy data structures take up less space
• Performance - they have a need for speed and are faster than lists
• Func onality - SciPy and NumPy have op mized func ons such as linear
algebra opera ons built in.
ti

ff
ti
ti
ti
ti
ti
fi
ti
ti

tt
ff
ti
ff
ti

ff

You might also like