@@ -0,0 +1,1568 @@
+import numpy as np%0A%0A# old way to do it, make 3 different arrays of data. The downside of this is that it doesnt necessarily %0A# tell us that these 3 are related data sets. Though then again its quite simple if you're not an idiot%0Aname = %5B%22Alice%22, %22Bob%22, %22Cathy%22, %22Doug%22%5D%0Aage = %5B25, 45, 37, 19%5D%0Aweight = %5B55.0, 85.5, 68.0, 61.5%5D%0A%0A# Now we can use a compound data type for structured arrays, creating%0A# a structured array with zeros of the 10character, 4byte integer, and 8byte float%0Adata = np.zeros(4, dtype=%7B'names':('name', 'age', 'weight'),%0A%09%09%09%09%09%09  'formats':('U10', 'i4', 'f8')%7D)%0Aprint(data.dtype)%0A%0A# now we can fill up this structured array. Hey this is R almost%0Adata%5B'name'%5D = name%0Adata%5B'age'%5D = age%0Adata%5B'weight'%5D = weight%0Aprint(data)%0A%0A# this is cool as it is now arranged as a np object and arragend in one contigious block of memory%0A# moreover all this stuff is nw accessible by name/index%0A# all names eg%0Adata%5B'name'%5D%0A%0A# This allows us to to cool filtering %0A# get names where age is under 30%0Adata%5Bdata%5B'age'%5D %3C 30%5D%5B'name'%5D%0A%0A# Pandas basically greatly expands on the functionality and usefulness of these structures%0A# with proper input/output control and stuff%0A%0A## Super advanced compound types%0A# it is possile to define even more advanced compound types. For example you fcan create a type %0A# where each element contains an array or matrix of values%0A# here will create a data type with a mat component consisting of a 3x3 floating point matrix%0A%0A# wow%0Atp = np.dtype(%5B('id', 'i8'), ('mat', 'f8', (3,3))%5D)%0AX = np.zeros(1,dtype = tp)%0Aprint(X%5B0%5D)%0Aprint(X%5B'mat'%5D%5B0%5D)%0A

Work on understanding a bit about structured arrays in NUmpy before moving on to pandas dataframes