import pandas as pd
Data Description
vehicle: model of the car
year: year of manufacture
msrp: manufacturer's suggested retail price in 2013 dollars
acceleration: acceleration rate in km per hour per second
mpg: fuel econonmy in miles per gallon
class: the model's class.
hybrid = pd.read_csv("hybrid.csv")
hybrid
hybrid.plot.scatter(x="acceleration", y="msrp")
hybrid.plot.scatter('mpg', 'msrp')
hybrid["sd_acceleration"] = (hybrid["acceleration"] - hybrid["acceleration"].mean()) / hybrid["acceleration"].std()
hybrid.head()
hybrid["sd_acceleration"] = (hybrid["acceleration"] - hybrid["acceleration"].mean()) / hybrid["acceleration"].std()
hybrid["sd_msrp"] = (hybrid["msrp"] - hybrid["msrp"].mean()) / hybrid["msrp"].std()
hybrid["sd_mpg"] = (hybrid["mpg"] - hybrid["mpg"].mean()) / hybrid["mpg"].std()
hybrid.plot.scatter(x="sd_acceleration", y="sd_msrp")
hybrid.plot.scatter('sd_mpg', 'sd_msrp')
raw_data = {
'x' : [1, 2, 3, 4, 5, 6],
'y' : [2, 3, 1, 5, 2, 7]
}
df = pd.DataFrame(raw_data)
df.plot.scatter(x='x', y='y')
df.corr()
df.corr()
raw_data = {
'x' : [1, 2, 3, 4],
'y' : [1, 2, 3, 4]
}
df = pd.DataFrame(raw_data)
df
df.corr()
raw_data = {
'x' : [1, 2, 3, 4, 5],
'y' : [1, 2, 3, 4, 0]
}
df = pd.DataFrame(raw_data)
df
df.corr()