User Tools

Site Tools


python:numpy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
python:numpy [2021/08/08 12:34] – [ndarray] utedasspython:numpy [2022/09/12 00:30] (current) – external edit 127.0.0.1
Line 20: Line 20:
  
 ===== Creation ===== ===== Creation =====
 +
 +<code python>
 +import numpy as np
 +
 +#### np.array(content) ####
 +np.array(4)
 +# array(4)
 +
 +np.array((1,2,3,4))
 +# array([1, 2, 3, 4])
 +
 +np.array(((1,2,3),(4,5,6)))
 +# array([[1, 2, 3],
 +#        [4, 5, 6]])
 +       
 +#### np.ndarray(shape) ####
 +np.ndarray(4)
 +# array([1.11949605e-311, 1.37961913e-306, 9.42677252e-321, 1.11829178e-311])
 +
 +np.ndarray((2,4))
 +# array([[0.   , 0.03 , 0.215, 0.4  ],
 +#        [0.586, 0.77 , 0.954, 1.   ]])
 +
 +</code>
  
 <code python> <code python>
Line 95: Line 119:
  
 ====== Linear algebra and math ====== ====== Linear algebra and math ======
 +
 +[[https://numpy.org/doc/stable/reference/routines.math.html|Math functions]]
  
 <code python> <code python>
python/numpy.1628426083.txt.gz · Last modified: 2022/09/12 00:30 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki