Professional Documents
Culture Documents
np.array():
numpy function to create an array from lists. Any number of lists can be send in as
arguments.
shape():
used to return the shape of the array created.
dtype():
returns the datatype of the members of the array.
zeros():
creates new numpy array with all zeroes.
ones():
all elements as 1
eye():
creates identity array/matrix.
arange(start,end,skip_value):
np.arange creates an array with values from start to end by skippind the value in
the third argument.
ARRAY INDEXING:
copy():
creates a new copy of the array.
2d arrays can also be sliced the same way 1D arrays are sliced.
For eg:
slice1 = arr2d[0:2,0:2]
To save to textfile
np.savetxt('name.txt',array1,delimiter=',')
To load textfile
np.loadtxt('name.txt', delimiter=',')
matplotlib is a package used for plotting various functions and graphs in python.
np.meshgrid()
assigns values to axes's by returning array values from its arguments.\
plt.imshow(function)
plots the function
plt.title("Title here")
Function to put the title of the graph
plt.colorbar()
to display the colorbar
plt.savefig('image_name.png')
to save the graph as an image in png format.
if x,y are integer arrays and cond is a boolean array then another integer array z
can be filed as
or
no.where(cond,x,y)
STANDARD FUNCTIONS
SERIES:
function used to create an object with the values in its arguments.
NaN values:
Not available values for indexes that doesnt have a value to assigned yet.
isnull()
notnull()
DATAFRAMES:
package fro pandas
importes as
***from pandas import pandas
read.clipboard()
returns the object with the text copied in clipboard.
dataframe functions
/*End of documentation.*/