import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
# Data set used in this exercise
data_filename = 'Advertising.csv'
# Read advertising.csv file using the pandas library
df = pd.read_csv(data_filename)
# Get a quick look of the data and columns
df.head()
### edTest(test_pandas) ###
# Select the first 7 rows
df_new = df.iloc[:7]
# Print your new dataframe to see if you have selected 7 rows correctly
print(df_new)
# Use a scatter plot for TV vs Sales
plt.scatter(df_new.TV,df_new.Sales)
# Add axis labels for clarity (x : TV budget, y : Sales)
plt.xlabel('TV')
plt.ylabel('Sales')
# Use a scatter plot for TV vs Sales
plt.scatter(df.TV,df.Sales)
# Add axis labels for clarity (x : TV budget, y : Sales)
plt.xlabel('TV')
plt.ylabel('Sales')