NumPy - NumPy Array Manipulation - numpy.ravel - NumPy

Explain the function of numpy.ravel

A one-dimensional array that is flattened is returned by this function and if required, a copy is made.The input array and the returned array have the same type. The parameter of the function is as follows:

Where,

S.No
Parameter & Description
1.
order
'C': row major (default. 'F': column major 'A': flatten in column-major order, if a is Fortran contiguous in memory, row-major order otherwise 'K': flatten a in the order the elements occur in the memory

Example

The output appears as:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

NumPy Topics