Kernel: Python 3 (system-wide)
Experiments in linspace and numpy types
This file contains come linspace experiments, a bit of for comprehension to cast the type to int. Basic refresher stuff. At the end we'll try to create an int array directly by setting dtype, then wondering what a dtype is, we hack on that. For more on dtypes, see the appprpriate section in the Numpy reference and the user guide.
In [6]:
array([ 2., 4., 6., 8.])
In [7]:
numpy.ndarray
In [25]:
numpy.float64
In [13]:
[2, 4, 6, 8]
In [17]:
[2, 4, 6, 8]
In [22]:
array([2, 4, 6, 8])
In [26]:
numpy.int32
In [32]:
<class 'int'>
<class 'numpy.int32'>