Manipulating Data Part 1: Using Matplotlib to display plots
What is Matplotlib? Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy.
Pandas should come pre-loaded with matplotlib up and running, but if not just run these two lines:
%matplotlib inline
Import matplotlib.pyplot as plt
Note: To display a plot inside Jupyter you need to use the Magic Function “%”
If you receive a data type error, you may need to change the data type. In this case, it was an Object and needed to be changed to an Integer.
Manipulating Data:
To change the data in the column, such as to all lowercase: car_sales[“Make”] = car_sales[“Make”].str.lower()
Often times imported data will be incomplete, which will show up at NaN when Pandas tries to display it.
Apply .fillna (appended with value) to the dataframe’s column to replace all NaN with a value.
Apply .dropna to remove rows with NaN
End of Part 1.