pwtools.atomic_data.masses¶
- pwtools.atomic_data.masses = array([ -1. , 1.00794 , 4.002602 , 6.941 , 9.012182 , 10.811 , 12.0107 , 14.0067 , 15.9994 , 18.9984032 , 20.1797 , 22.98976928, 24.305 , 26.9815386 , 28.0855 , 30.973762 , 32.065 , 35.453 , 39.948 , 39.0983 , 40.078 , 44.955912 , 47.867 , 50.9415 , 51.9961 , 54.938045 , 55.845 , 58.933195 , 58.6934 , 63.546 , 65.38 , 69.723 , 72.64 , 74.9216 , 78.96 , 79.904 , 83.798 , 85.4678 , 87.62 , 88.90585 , 91.224 , 92.90638 , 95.96 , 98. , 101.07 , 102.9055 , 106.42 , 107.8682 , 112.411 , 114.818 , 118.71 , 121.76 , 127.6 , 126.90447 , 131.293 , 132.9054519 , 137.327 , 138.90547 , 140.116 , 140.90765 , 144.242 , 145. , 150.36 , 151.964 , 157.25 , 158.92535 , 162.5 , 164.93032 , 167.259 , 168.93421 , 173.054 , 174.9668 , 178.49 , 180.94788 , 183.84 , 186.207 , 190.23 , 192.217 , 195.084 , 196.966569 , 200.59 , 204.3833 , 207.2 , 208.9804 , 209. , 210. , 222. , 223. , 226. , 227. , 232.03806 , 231.03588 , 238.02891 , 237. , 244. , 243. , 247. , 247. , 251. , 252. , 257. , 258. , 259. , 262. , 267. , 268. , 271. , 272. , 270. , 276. , 281. , 280. , 285. , 284. , 289. , 288. , 293. , 294. ])¶
- ndarray(shape, dtype=float, buffer=None, offset=0,
strides=None, order=None)
An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, whether it is an integer, a floating point number, or something else, etc.)
Arrays should be constructed using array, zeros or empty (refer to the See Also section below). The parameters given here refer to a low-level method (ndarray(…)) for instantiating an array.
For more information, refer to the numpy module and examine the methods and attributes of an array.
- Parameters:
below) ((for the __new__ method; see Notes)
shape (tuple of ints) – Shape of created array.
dtype (data-type, optional) – Any object that can be interpreted as a numpy data type.
buffer (object exposing buffer interface, optional) – Used to fill the array with data.
offset (int, optional) – Offset of array data in buffer.
strides (tuple of ints, optional) – Strides of data in memory.
order ({'C', 'F'}, optional) – Row-major (C-style) or column-major (Fortran-style) order.
- pwtools.atomic_data.T¶
Transpose of the array.
- Type:
ndarray
- pwtools.atomic_data.data¶
The array’s elements, in memory.
- Type:
buffer
- pwtools.atomic_data.dtype¶
Describes the format of the elements in the array.
- Type:
dtype object
- pwtools.atomic_data.flags¶
Dictionary containing information related to memory use, e.g., ‘C_CONTIGUOUS’, ‘OWNDATA’, ‘WRITEABLE’, etc.
- Type:
dict
- pwtools.atomic_data.flat¶
Flattened version of the array as an iterator. The iterator allows assignments, e.g.,
x.flat = 3
(See ndarray.flat for assignment examples; TODO).- Type:
numpy.flatiter object
- pwtools.atomic_data.imag¶
Imaginary part of the array.
- Type:
ndarray
- pwtools.atomic_data.real¶
Real part of the array.
- Type:
ndarray
- pwtools.atomic_data.size¶
Number of elements in the array.
- Type:
int
- pwtools.atomic_data.itemsize¶
The memory use of each array element in bytes.
- Type:
int
- pwtools.atomic_data.nbytes¶
The total number of bytes required to store the array data, i.e.,
itemsize * size
.- Type:
int
- pwtools.atomic_data.ndim¶
The array’s number of dimensions.
- Type:
int
- pwtools.atomic_data.shape¶
Shape of the array.
- Type:
tuple of ints
- pwtools.atomic_data.strides¶
The step-size required to move from one element to the next in memory. For example, a contiguous
(3, 4)
array of typeint16
in C-order has strides(8, 2)
. This implies that to move from element to element in memory requires jumps of 2 bytes. To move from row-to-row, one needs to jump 8 bytes at a time (2 * 4
).- Type:
tuple of ints
- pwtools.atomic_data.ctypes¶
Class containing properties of the array needed for interaction with ctypes.
- Type:
ctypes object
- pwtools.atomic_data.base¶
If the array is a view into another array, that array is its base (unless that array is also a view). The base array is where the array data is actually stored.
- Type:
ndarray
See also
array
Construct an array.
zeros
Create an array, each element of which is zero.
empty
Create an array, but leave its allocated memory unchanged (i.e., it contains “garbage”).
dtype
Create a data-type.
numpy.typing.NDArray
An ndarray alias generic w.r.t. its dtype.type <numpy.dtype.type>.
Notes
There are two modes of creating an array using
__new__
:If buffer is None, then only shape, dtype, and order are used.
If buffer is an object exposing the buffer interface, then all keywords are interpreted.
No
__init__
method is needed because the array is fully initialized after the__new__
method.Examples
These examples illustrate the low-level ndarray constructor. Refer to the See Also section above for easier ways of constructing an ndarray.
First mode, buffer is None:
>>> np.ndarray(shape=(2,2), dtype=float, order='F') array([[0.0e+000, 0.0e+000], # random [ nan, 2.5e-323]])
Second mode:
>>> np.ndarray((2,), buffer=np.array([1,2,3]), ... offset=np.int_().itemsize, ... dtype=int) # offset = 1*itemsize, i.e. skip first element array([2, 3])