What are the two main pandas data structures?
import statement for pandas?
import pandas as pd
How to read a csv in pandas?
How do we look at the first 10 and last 10 entries in a dataframe?
What is an issue that arises here?
Cant view both at the same time use the name of the dataframe e.g. just “iris” to display both the first and last 5 entries in a data frame
doing this also displays the number of rows and columns in the dataframe
How do you “print” both the head and tail of a table in the same comand line
What does df.info report?
What does df.describe() report?
How would we pull the column “sepal_length” from the iris dataframe?
What are the three ways of indexing and selecting data in a dataframe?
for the iris dataframe, display two new data frames where df1 contains the columns “sepal_length” and “sepal_width” using column name indexing and the second contains displays the same using slicing?
How do we print the shape of dataframe?
df.shape
What are the two ways to extract the design matrix X and vector of targets y from the iris Dataframe?
How can we find the mean of a df using np?
np.mean(df)
How can we sort a dataframe based off as specific column in ascending order?
in desending order can set ascending = False or drop it from the code all together
What do we need to check if our csv isnt not in columns?
Need to check how it is separated in this case it was separated by a semi-colon
What is the import statement for seaborn?
import seaborn as sns
as the guys name was Samuel Norman Seaborn
What does the following code display?
sns.pairplot(iris, hue=’species’)
plt.show()
How do I adjust this function to only display the lower corner (as it is a mirror of the upper corner) and adjust the markets of the graphs)?
How do you use seaborn to plot this following graph for the iris dataset?
What does it show?
removing the inner quartile replaces it with a boxplot
Also as seaborn likes the graphs to be based on categorical data if you swap the x and y axis the graph will be orientated horizontally.
How do I create a heatmap for the data set “flights” with seaborn?
What do we use scikit-learn for?
What are the import states for some of the main ML algos we will use?
from sklearn import linear_model,tree
Given our design matrix X and label vector y how can I use SVM to train and make a prediction on the sollowing unseen array?
X_unseen = np.array([[6.7, 2.8, 5.2, 2.1]])
How do I adjust this code to use the decision tree classifier?