Sideway
output.to from Sideway
`-=[]โŸจโŸฉ\;',./~!@#$%^&*()_+{}|:"<>? ๐‘Ž๐‘๐‘๐‘‘๐‘’๐‘“๐‘”โ„Ž๐‘–๐‘—๐‘˜๐‘™๐‘š๐‘›๐‘œ๐‘๐‘ž๐‘Ÿ๐‘ ๐‘ก๐‘ข๐‘ฃ๐‘ค๐‘ฅ๐‘ฆ๐‘ง ร…โ€‰โˆ’โ€‚ร—โ€ƒโ‹…โˆ“ยฑโˆ˜๊žŠ๏นฆโˆ—โˆ™ โ„ฏ ๐”ธ๐”นโ„‚๐”ป๐”ผ๐”ฝ๐”พโ„๐•€๐•๐•‚๐•ƒ๐•„โ„•๐•†โ„™โ„šโ„๐•Š๐•‹๐•Œ๐•๐•Ž๐•๐•โ„ค๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐‘€๐‘๐‘‚๐‘ƒ๐‘„๐‘…๐‘†๐‘‡๐‘ˆ๐‘‰๐‘Š๐‘‹๐‘Œ๐‘ โˆผโˆฝโˆพโ‰โ‰‚โ‰ƒโ‰„โ‰…โ‰†โ‰‡โ‰ˆโ‰‰โ‰Œโ‰โ‰ โ‰ก โ‰คโ‰ฅโ‰ฆโ‰งโ‰จโ‰ฉโ‰ชโ‰ซ โˆˆโˆ‰โˆŠโˆ‹โˆŒโˆ โŠ‚โŠƒโŠ„โŠ…โІโЇ ๐›ผ๐›ฝ๐›พ๐›ฟ๐œ€๐œ๐œ‚๐œƒ๐œ„๐œ…๐œ†๐œ‡๐œˆ๐œ‰๐œŠ๐œ‹๐œŒ๐œŽ๐œ๐œ๐œ‘๐œ’๐œ“๐œ” โˆ€โˆ‚โˆƒโˆ…โฆฐโˆ†โˆ‡โˆŽโˆžโˆโˆดโˆต โˆโˆโˆ‘โ‹€โ‹โ‹‚โ‹ƒ โˆงโˆจโˆฉโˆช โˆซโˆฌโˆญโˆฎโˆฏโˆฐโˆฑโˆฒโˆณ โˆฅโ‹ฎโ‹ฏโ‹ฐโ‹ฑ โ€– โ€ฒ โ€ณ โ€ด โ„ โ— สน สบ โ€ต โ€ถ โ€ท ๏น ๏น‚ ๏นƒ ๏น„ ๏ธน ๏ธบ ๏ธป ๏ธผ ๏ธ— ๏ธ˜ ๏ธฟ ๏น€ ๏ธฝ ๏ธพ ๏น‡ ๏นˆ ๏ธท ๏ธธ โœ   โ   โŽด  โŽต  โž   โŸ   โ    โก โ†โ†‘โ†’โ†“โ†คโ†ฆโ†ฅโ†งโ†”โ†•โ†–โ†—โ†˜โ†™โ–ฒโ–ผโ—€โ–ถโ†บโ†ปโŸฒโŸณ โ†ผโ†ฝโ†พโ†ฟโ‡€โ‡โ‡‚โ‡ƒโ‡„โ‡…โ‡†โ‡‡ โ‡โ‡‘โ‡’โ‡“โ‡”โ‡Œโ‡โ‡โ‡•โ‡–โ‡—โ‡˜โ‡™โ‡™โ‡ณโฅขโฅฃโฅคโฅฅโฅฆโฅงโฅจโฅฉโฅชโฅซโฅฌโฅญโฅฎโฅฏ
Draft for Information Only

Content

NumPy
โ€ƒInstallation
โ€ƒโ€ƒConda
โ€ƒโ€ƒPIP
โ€ƒโ€ƒAnaconda
โ€ƒNumpy Objects
โ€ƒโ€ƒArray Objects
โ€ƒโ€ƒโ€ƒndarray Object
โ€ƒโ€ƒโ€ƒโ€ƒExamples
โ€ƒโ€ƒโ€ƒArray Scalars
โ€ƒโ€ƒโ€ƒโ€ƒExamples
โ€ƒโ€ƒโ€ƒData type objects
โ€ƒโ€ƒโ€ƒโ€ƒExamples
โ€ƒโ€ƒโ€ƒโ€ƒExamples
โ€ƒโ€ƒConstants
โ€ƒSource and Reference

NumPy

NumPy is a Python package with well-optimized C core. 
NumPy provides powerful N-dimensional array computing through the using of concepts of vectorization, indexing, and broadcasting. Besides, Numpy also offers comprehensive mathematical functions for numerical computing.
Fast and versatile, the NumPy vectorization, indexing, and broadcasting concepts are the de-facto standards of array computing today.

Installation

The only prerequisite for installing NumPy is Python itself.

Conda

# Best practice, use an environment rather than install in the base env
conda create -n my-env
conda activate my-env
# If you want to install from conda-forge
conda config --env --add channels conda-forge
# The actual install command
conda install numpy

PIP

pip install numpy

Anaconda

The installation of Anaconda will also installs Numpy and some other useful tools and packages.

Numpy Objects

Working data of NumPy is stored in an N-dimensional array object. image

Array Objects

ndarray Object

The N-dimensional array, ndarray, is a multidimensional container of items of the same type and size. Different ndarrays can share th same data as usual. That is an ndarray can be a view to another ndarray. The typical characteristics of a ndarray are dtype and shape
Examples
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> x=[[1,2,3],[4,5,6],[7,8,9]]
>>> x
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
>>> type(x)
<class 'list'>
>>> import numpy as np
>>> x=np.array(x)
>>> type(x)
<class 'numpy.ndarray'>
>>> x.dtype
dtype('int32')
>>> x.shape
(3, 3)
>>>

Array Scalars

A array scalar is the basic array unit element of a ndarray. Array scalars have the same attributes and methods as ndarrays.
Examples
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> x=np.array([[1,2,3],[4,5,6],[7,8,9]])
>>> x.shape
(3, 3)
>>> x.dtype
dtype('int32')
>>> x[0,0]
1
>>> x[0,0].shape
()
>>> x[0,0].dtype
dtype('int32')
>>>

Data type objects

A data type object is used to describe how the bytes in the fixed-size block of memory corresponding to an array item of a ndarray should be interpreted.
Examples
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> x=np.array([3])
>>> x.dtype
dtype('int32')
>>>
>>> np.int32
<class 'numpy.int32'>
>>>
>>> dt=np.dtype('int32')
>>> dt.name
'int32'
>>> dt.itemsize
4
>>> dt.byteorder
'='
>>> dt.kind
'i'
>>>
Examples
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> dt = np.dtype([('string', np.unicode_, 16), ('numberpair', np.float64, (2,))
])
>>> dt
dtype([('string', '<U16'), ('numberpair', '<f8', (2,))])
>>> dt['string']
dtype('<U16')
>>> dt['numberpair']
dtype(('<f8', (2,)))
>>>
>>> x = np.array([('asdf', (1,2)), ('hjkl', (3,4))], dtype=dt)
>>> x.shape
(2,)
>>> x.dtype
dtype([('string', '<U16'), ('numberpair', '<f8', (2,))])
>>> type(x)
<class 'numpy.ndarray'>
>>> x[0]
('asdf', [1., 2.])
>>> x[0].shape
()
>>> x[0].dtype
dtype([('string', '<U16'), ('numberpair', '<f8', (2,))])
>>> type(x[0])
<class 'numpy.void'>
>>> x[0]['string']
'asdf'
>>> x[0]['string'].shape
()
>>> x[0]['string'].dtype
dtype('<U4')
>>> type(x[0]['string'])
<class 'numpy.str_'>
>>>

Constants

NumPy includes some common constants, such as infinity, e, pi, for floating-point arithmetic

Source and Reference

  • https://numpy.org/
  • https://numpy.org/install/
  • https://numpy.org/doc/stable/reference/index.html
  • https://numpy.org/doc/stable/index.html
  • https://en.wikipedia.org/wiki/NumPy

ยฉsideway

ID: 220100007 Last Updated: 1/7/2022 Revision: 0


Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 9

Culture

Chinese 1097

English 339

Travel 38

Reference 79

Hardware 55

Computer

Hardware 259

Software

Application 213

Digitization 37

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 290new

Unicode 504

HTML 66new

Common Color 1new

Html Entity (Unicode) 1new

Html 401 Special 1

CSS 65new

Selector 1

SVG 46

ASP.NET 270

OS 447new

MS Windows

Windows10 1new

.NET Framework 1

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Set 1

Logic 1

Algebra 84

Number Theory 207new

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2026 Sideway . All rights reserved Disclaimers last modified on 06 September 2019