< data analysis using Python > Note 2

Source: Internet
Author: User


More important Ndarray object properties in an array of numpy:

Ndarray.ndim: The number of dimensions (that is, the number of array axes) of the array, equal to the rank. The most common are two-dimensional arrays (matrices). ndarray.itemsize: The byte size of each element in the array. For example, an array with an element type of Float64 Itemsiz property value of 8 (float64 consumes 64 bits, each byte is 8, so 64/8, takes 8 bytes), and An array with an element type of complex32 the Item property is 4 (32/8).
inch Python float32: Standard single-precision floating-point number, float64: Standard double-precision floating-point number compatible with double C.

Single-precision type (float) and double type (double):
The range of float is -2^128 ~ +2^128, i.e. -3.4*1038~3.4*1038
, 32 bits of binary bits.
Accuracy: Valid digital 6~7,2^23 = 8388608, total 7 bits, which means there can be up to 7 significant digits.
The double range is -2^1024 ~ +2^1024, or -1.7*10308~1.7*10308, bits number 64 bits.
Accuracy: Valid number 15~16,2^52 = 4503599627370496, total 16 digits, valid number is 15~16 bit

Float

8bits (digital digit) 2^7=128

23bits (tail digit)

Double

11bits (digital digit) 2^10=1024

52bits (tail digit)

Np.arange ():

Dtype (data type):

Astype ():

* * 2 multiplication sign is the exponentiation. Like 2**4, the result is 2 of 4, and the result is 16.

The usage of RANDN ():

1, in []: arr = Randn (5, 3)

2, in []: arr = Np.random.randn (5, 4)

< data analysis using Python > Note 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.