Created
December 14, 2018 07:06
-
-
Save nithyadurai87/d93a853d86cf5500011cb41308dd1935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
df = pd.read_csv("14_input_data.csv") | |
df = df.fillna(0) | |
df = df[:500] | |
fig = plt.figure(figsize=(8,6)) | |
ax = fig.add_subplot(111) | |
ax.set(title='Living area vs Price of the house', | |
xlabel='Price', ylabel='Area') | |
price = df['SalePrice'].tolist() | |
area = df['GrLivArea'].tolist() | |
ax.scatter(price,area) | |
plt.savefig('ScatterPlot.jpg') | |
df2 = pd.DataFrame() | |
df2['sale'] = df['SalePrice'] | |
df2['area'] = df['GrLivArea'] | |
fig = plt.figure(figsize=(12,12)) | |
r = sns.heatmap(df2, cmap='BuPu') | |
plt.savefig('HeatMapSeaborn.jpg') | |
fig = plt.figure(figsize=(8,6)) | |
ax = fig.add_subplot(111) | |
ax.set(title="Total Living Sq.Ft", | |
ylabel='No of Houses', xlabel='Living Sq.Ft') | |
ax.hist2d(price,area,bins=100) | |
plt.savefig('HeatMapMatplotlib.jpg') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment