Professional Documents
Culture Documents
Part B - Program 1
Part B - Program 1
In [3]: df
Out[3]:
Car_Name Year Selling_Price Present_Price Kms_Driven Fuel_Type Seller_Type Tra
In [4]: # Scatter plots are used to observe and show relationships between two nume
# Scatter plot betwwen selling price and present price
plt.scatter(df["Selling_Price"], df["Present_Price"])
plt.xlabel("Selling Price")
plt.ylabel("Present Price")
plt.show()
Out[5]: 4.661295681063123
Out[6]: 32000.0
Out[7]: 5.082811556177803
Out[8]: 1512189738.0574305
In [10]: m
Out[10]: 1.4948471869862356
In [11]: r = m*df["Selling_Price"] + b
In [12]: plt.scatter(df["Selling_Price"],df["Present_Price"])
plt.plot(df["Selling_Price"], r, color='red')
plt.show()