Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python NumPy Shape function example Printing the shape of the multidimensional array

# Welcome to softhunt.net
import numpy as npy
 
# creating a 2-d array
arr1 = npy.array([[4, 5, 6, 7], [1, 2, 3, 4]])
 
# creating a 3-d array
arr2 = npy.array([[[8, 7], [6, 5]], [[4, 3], [2, 1]]])
 
# printing the shape of arrays
# first element of tuple gives
# dimension of arrays second
# element of tuple gives number
# of element of each dimension
print(arr1.shape)
print(arr2.shape)
Comment

PREVIOUS NEXT
Code Example
Python :: Updating hash password in python 
Python :: run all pycharm jupyter notebook 
Python :: Django merge duplicate rows 
Python :: text xml 
Python :: pypi autopep8 
Python :: python dictionary examples 
Python :: Python NumPy asanyarray Function Syntax 
Python :: Python NumPy asarray_chkfinite Function Example List to an array 
Python :: Python NumPy hstack Function Syntax 
Python :: seaborn log heatmap 
Python :: Python NumPy delete Function Example Deletion performed using Boolean Mask 
Python :: como saber si un string es un numero python 
Python :: Python __ge__ 
Python :: modles en django 
Python :: program adxl335 python 
Python :: Create a list of multiples of 3 from 0 to 20. 
Python :: bash1 
Python :: selenium python select elements data atribute 
Python :: downgrading to previous migration django 
Python :: call a Python range() using range(stop) 
Python :: unauthorized vue django rest framework 
Python :: Data Extraction in Python 
Python :: how to Capture only the ICMP packet. using bpf 
Python :: Dynamic INSERT to SQLite 
Python :: Hide div element using python in Flask 
Python :: Python (cpython 2.7.16) sample 
Python :: Frog Jump time complexity 
Python :: tkinter disabled but selectable 
Python :: Python cut down OS path to certain part 
Python :: bot that only responds to certain roles discord.py 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =