Manipulating Data Part 1: Using Matplotlib to display plots

MORGAN KATZ
2 min readJul 11, 2020

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.

--

--

MORGAN KATZ
0 Followers

Business Analyst with an MBA in Business Intelligence. Machine learning student. Exploring data through analysis and solving problems using ML tools.