lundi 30 décembre 2019

Pandas: create a random sample and correlation matrix

How to create a subset of the data that contains a random sample of 200 observations (database create form a csv file)

Data columns (total 10 columns): longitude 20640 non-null float64 latitude 20640 non-null float64 housing_median_age 20640 non-null float64 total_rooms 20640 non-null float64 total_bedrooms 20433 non-null float64 population 20640 non-null float64 households 20640 non-null float64 median_income 20640 non-null float64 median_house_value 20640 non-null float64 ocean_proximity 20640 non-null object

How to determine the correlations between housing values(median_house_value) and the other variables and display in descending order.

df.corr() gives me all the correlations. How to make it show only the median house value?




Aucun commentaire:

Enregistrer un commentaire