<jupyter_start><jupyter_text>Intro to Pandas and Matplotlib<jupyter_code>#import libraries
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline

#download the csv from google and load it with Pandas
!wget -O FuelConsumption.csv https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/ML0101ENv3/labs/FuelConsumptionCo2.csv
df = pd.read_csv("FuelConsumption.csv")
df.head()
#show metrics of the loaded data
#this is pretty interesting
df.describe()
#now load up only specific columns, then show only a certain number of rows
cdf = df[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_COMB','CO2EMISSIONS']]
cdf.head(9)
#from a given dataset, build and show a graph
viz = cdf[['CYLINDERS','ENGINESIZE','CO2EMISSIONS','FUELCONSUMPTION_COMB']]
viz.hist()
plt.show()
#scatter charts of two columns from a previously loaded pandas object
plt.scatter(cdf.FUELCONSUMPTION_COMB, cdf.CO2EMISSIONS,  color='blue')
plt.xlabel("FUELCONSUMPTION_COMB")
plt.ylabel("Emission")
plt.show()
#same, but with new data
plt.scatter(cdf.ENGINESIZE, cdf.CO2EMISSIONS,  color='blue')
plt.xlabel("Engine size")
plt.ylabel("Emission")
plt.show()
#and two more.
plt.scatter(cdf.CYLINDERS, cdf.CO2EMISSIONS,  color='blue')
plt.xlabel("Cylinders")
plt.ylabel("Emission")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1276595744680851, 'fraction_numerical': 0.009878419452887538, 'mean_word_length': 7.030487804878049, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '200264', 'license': 'MIT', 'n_tokens_mistral': 527, 'n_tokens_neox': 497, 'n_words': 112, 'path': 'Course-1/Week-2/Intro to Pandas and Matplotlib.ipynb', 'repo_name': 'nwalker85/coursera-ibm-ai', 'size': '1316'}