<jupyter_start><jupyter_text>HW3,Q2 <NAME> Q2.a<jupyter_code>import pandas as pd
import matplotlib as plt
import numpy as np
import seaborn as sns
house= pd.read_csv("housing.csv")
house.head()
sns.pairplot(house)<jupyter_output><empty_output><jupyter_text>Q2.b<jupyter_code>house.corr()<jupyter_output><empty_output><jupyter_text>Q2.d<jupyter_code>from scipy import stats
stats.pearsonr(house['median_income'], house['median_house_value'])<jupyter_output><empty_output><jupyter_text>Q2.e<jupyter_code>stats.spearmanr(house['housing_median_age'],house['total_rooms'])<jupyter_output><empty_output><jupyter_text>Q2.f<jupyter_code>house.corr(method='spearman')<jupyter_output><empty_output><jupyter_text>Q2.g<jupyter_code>house['ocean_proximity']=house['ocean_proximity'].replace('<1H OCEAN',0)
house['ocean_proximity']=house['ocean_proximity'].replace('INLAND',1)
house['ocean_proximity']=house['ocean_proximity'].replace('ISLAND',2)
house['ocean_proximity']=house['ocean_proximity'].replace('NEAR BAY',3)
house['ocean_proximity']=house['ocean_proximity'].replace('NEAR OCEAN',4)
house.head(20)
sns.heatmap(house)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1637478108581436, 'fraction_numerical': 0.014010507880910683, 'mean_word_length': 19.05263157894737, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '412148', 'license': 'MIT', 'n_tokens_mistral': 488, 'n_tokens_neox': 472, 'n_words': 36, 'path': 'Homeworks/HW3/Q2/Q2.ipynb', 'repo_name': 'GhazaleZe/Data-Mining-Fundamentals', 'size': '1151'}