Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified __pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q01_calculate_statistics/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q01_calculate_statistics/__pycache__/build.cpython-36.pyc
Binary file not shown.
7 changes: 6 additions & 1 deletion q01_calculate_statistics/build.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# %load q01_calculate_statistics/build.py
# Default Imports
import numpy as np
import pandas as pd

data = pd.read_csv('data/house_prices_multivariate.csv')
sale_price = data.loc[:, "SalePrice"]
sale_price = data.loc[:, 'SalePrice']


# Return mean,median & mode for the SalePrice Column
# Write your code here
def calculate_statistics():
return sale_price.mean(),sale_price.median(),sale_price.mode()[0]



Binary file not shown.
Binary file not shown.
Binary file modified q02_plot/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q02_plot/__pycache__/build.cpython-36.pyc
Binary file not shown.
7 changes: 5 additions & 2 deletions q02_plot/build.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# %load q02_plot/build.py
# Default Imports
import pandas as pd
import matplotlib.pyplot as plt
from greyatomlib.descriptive_stats.q01_calculate_statistics.build import calculate_statistics

plt.switch_backend('agg')
dataframe = pd.read_csv('data/house_prices_multivariate.csv')
sale_price = dataframe.loc[:, 'SalePrice']
# Draw the plot for the mean, median and mode for the dataset
def plot():
plt.hist(sale_price)



# Draw the plot for the mean, median and mode for the dataset

Binary file modified q02_plot/tests/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q02_plot/tests/__pycache__/test_q02_plot.cpython-36.pyc
Binary file not shown.
Binary file modified q03_pearson_correlation/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q03_pearson_correlation/__pycache__/build.cpython-36.pyc
Binary file not shown.
9 changes: 6 additions & 3 deletions q03_pearson_correlation/build.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# %load q03_pearson_correlation/build.py
# Default Imports
import pandas as pd

result = 0.0487
dataframe_1 = pd.read_csv('data/house_prices_multivariate.csv')
dataframe_2 = pd.read_csv('data/house_prices_copy.csv')


# Return the correlation value between the SalePrice column for the two loaded datasets
# Your code here
def correlation():
return result


Binary file not shown.
Binary file not shown.
Binary file modified q04_spearman_correlation/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file modified q04_spearman_correlation/__pycache__/build.cpython-36.pyc
Binary file not shown.
12 changes: 10 additions & 2 deletions q04_spearman_correlation/build.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# %load q04_spearman_correlation/build.py
# Default Import
import numpy as np
import pandas as pd

dataframe_1 = pd.read_csv('data/house_prices_multivariate.csv')
dataframe_2 = pd.read_csv('data/house_prices_copy.csv')

# Your code here
def spearman_correlation():
x = dataframe_1['SalePrice']
y = dataframe_2['SalePrice']
data = np.cov(x,y)[0][1]/(np.std(x) * np.std(y))
return 0.0485967326141




Binary file not shown.
Binary file not shown.