A box plot’s whiskers are the lines that extends from the 1st or 3rd quartile to points farthest from the median. The upper whisker of the box plot is the largest dataset number smaller than 1.5IQR above the third quartile and the lower whisker is the smallest dataset number larger than 1.5IQR below the. Cheatography is a collection of 4308 cheat sheets and quick references in 25 languages for everything from programming to maths! Behind the Scenes If you have any problems, or just want to say hi, you can find us right here.
Python Cheat sheet (from your instructor) Note: All of these commands are based on Python 2.x versions not 3.x This by no means is comprehensive, but it will help you with a few tasks in lab 1 and HW 1. 1) Reading a file into the python environment file='myfile.txt' fl=open(file,'r')! 2) Writing and calling executable python files. Python Cheat sheet (from your instructor) Note: All of these commands are based on Python 2.x versions not 3.x This by no means is comprehensive, but it will help you with a few tasks in lab 1 and HW 1. 1) Reading a file into the python environment file='myfile.txt' fl=open(file,'r')! 2) Writing and calling executable python files.
Matplotlib is used to plot graphs so it is often used alongside Numpy.
Always use:
import matplotlib.pyplot as plt
import numpy as np (assuming numpy is always used with matplotlib)
- Plotting a 1D array:
plt.plot(xarray,yarray)
plt.show()
- Plotting a 2D array:
Colour images:
image = np.array([[0,1,2],[3,4,5]])
plt.imshow(image, cmap = plt.cm.jet) # creates the image based on the array image and #cmap (colour map) jet
plt.colorbar() #creates a legend bar
plt.show() #displays the plot
- Adding labels to the graphs:
plt.xlabel(“Insert label for x axis here”)
plt.ylabel(“Insert label for y axis here”)
—
http://matplotlib.org/users/pyplot_tutorial.html – Pyplot tutorial
Some frequent needed utilities in Python data scripts —— good to have it by hand when facing puzzle.
ETL
Data Loading
Indexing
Sorting
Pyplot Cheat Sheet Excel
Dropping
Slicing
Dealing with missings
Sampling
Apply function
Pyplot Cheat Sheet
Dealing with datetime
Categorical to dummy
concat & join
Groupby
Differencing & Cumulation
Sliding Window Apply
Regular Expression
Descriptive Stats
Numerical stats
Correlation
Pyplot Cheat Sheet Pdf
Basic Charts
Feature Engineering
Rescaling
Feature Binarization
Generating Polynomial Features
Feature Selection
Filter methods
Wrapper Methods
Algorithm
Frequent Used Pieces
Linear Regression
Kmeans
Random Forest
Time Series
Tuning & Validation
Training/Test split
Cross Validation
Exhaustive Grid Search