INFO1110 Lecture Notes - Lecture 13: 8-Bit, Arbitrary-Precision Arithmetic, Floating Point
Document Summary
Data types, multi-dimensional arrays, and numpy numpy numpy is a python module that gives access to native data types in the cpu. Note: in semester 1 2018, numpy specifically was not assessed in the final exam, mainly focusing on arrays in general, not how they could be implemented in python specifically. 3 bits 23 = 8 possible values. Integers in numpy import numpy as np x = np. uint8(34) Integer overflow occurs when we try to represent values outside the allowable range. Floats represent fractional/decimal numbers in scientific notation with base 2. Typical floats use 4 bytes of memory, but python 3 has arbitrary precision. Has three parts, the sign, mantissa/coefficient, and the exponent. Floats in numpy import numpy as np x = np. float32(3. 1415296) Arrays: collection of a single data type, contiguous in memory (no gaps, python has arrays based on c numpy arrays. Each array has its own index, e. g. arr[0][1]