Data visualization Flashcards
import matplotlib as plt
import matplotlib.pyplot as plt
% matplotlib inline
Purpose of “%matplotlib inline”
It is a magic function that renders the figure in a notebook (instead of displaying a dump of the figure object).
What does Pandas dropna does?
Pandas dropna() method allows the user to analyze and drop Rows/Columns with Null values in different ways.
DataFrameName.dropna(axis=0, how=’any’, thresh=None, subset=None, inplace=False)
Show scatter plot of recent_grads.csv being x sample_size and y Median
recent_grads.plot(x=’Sample_size’, y=’Median’, kind=’scatter’)
Show a scatter plot of recent_grads.csv, x= Sample_size and y=Unemployment_rate
recent_grads.plot(x=’Sample_size’, y=’Unemployment_rate’, kind=’scatter’)
Show a scatter plot of recent_grads.csv, x= Full_time and y= Median
recent_grads.plot(x=’Full_time’, y=’Median’, kind=’scatter’)
Show a scatter plot of recent_grads, x=ShareWomen and y= Unemployment_rate
recent_grads.plot(x=’ShareWomen’, y=’Unemployment_rate’, kind=’scatter’)
Show a scatter plot of recent grads, x=Men and y= Median
recent_grads.plot(x=’Men’, y=’Median’, kind=’scatter’)
Show a scatter plot of recent grads, x= Women and y= Median
recent_grads.plot(x=’Women’, y=’Median’, kind=’scatter’)
Import scatter matrix
from pandas.plotting import scatter_matrix
Show scatter matrix plot from recent_grads using sample sixe and Median, with figsize of (6,6)
scatter_matrix(recent_grads[[‘Sample_size’, ‘Median’]], figsize=(6,6))
Show scatter matrix plot from recent_grads using sample size, median and Unemployment_rate, with figsize of (10,10)
scatter_matrix(recent_grads[[‘Sample_size’, ‘Median’, ‘Unemployment_rate’]], figsize=(10,10))
Show plot bars from the first 10 majors, x= Major and y = Sharewomen
recent_grads[:10].plot.bar(x=’Major’, y=’ShareWomen’, legend=False)