Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python NumPy ravel function example Showing ordering manipulation

# Welcome to softhunt.net
# Python Program illustrating
# numpy.ravel() method

import numpy as np

array = np.arange(15).reshape(5, 3)
print("Original array : 
", array)

# Output comes like [ 0 1 2 ..., 12 13 14]
# as it is a long output, so it is the way of
# showing output in Python

# About :
print("
About numpy.ravel() : ", array.ravel)

print("
numpy.ravel() : ", array.ravel())

# Maintaining both 'A' and 'F' order
print("
Maintains A Order : ", array.ravel(order = 'A'))

# K-order preserving the ordering
# 'K' means that is neither 'A' nor 'F'
array2 = np.arange(12).reshape(2,3,2).swapaxes(1,2)
print("
array2 
", array2)
print("
Maintains A Order : ", array2.ravel(order = 'K'))
Comment

PREVIOUS NEXT
Code Example
Python :: intervalle de temps python 
Python :: jupyter extension 4 
Python :: how to murj record in django 
Python :: get minimum value function with anealing in python 
Python :: how to make dinamic table in jinja python 
Python :: how to import scypy in python 
Python :: Python NumPy asarray Function Example Tuple to an array 
Python :: Python NumPy asarray_chkfinite Function Syntax 
Python :: create game board with radone values within a range python 
Python :: add a new field to a Hosted Feature Layer 
Python :: Python NumPy insert Function Example Using insertion at different points 
Python :: unsupported operand type python 
Python :: python __truediv__ 
Python :: object at being output python 
Python :: Open S3 object as string in Python 3 
Python :: sourcetrail index library python 
Python :: python subprocess redirect a file 
Python :: qlcdnumber set value 
Python :: complete dates pandas per group by 
Python :: Demonstration of Python range() 
Python :: Visual Studio Code pylint: Error when all is ok 
Python :: python how do I count the time that it takes for the sorting to execute in seconds? [closed] 
Python :: operasi tipe data integer 
Python :: load SQLite db into memory 
Python :: Redirect to the same page and display a message if user insert wrong data 
Python :: python QFileDialog select files 
Python :: xchacha20 
Python :: ring Using This in the class region as Self 
Python :: django bring specific values first 
Python :: Uso de lambda 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =