Update 5/1/README.md

Visualizing the heatmap with `df` will throw an error because there are string-type columns. Filter the data with only numberic data types.
pull/677/head
Ben Wallace 2 years ago committed by GitHub
parent 60b5d9f874
commit 70cf42d37f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -258,9 +258,12 @@ Note, when the top genre is described as 'Missing', that means that Spotify did
1. Do a quick test to see if the data correlates in any particularly strong way:
```python
corrmat = df.corr()
f, ax = plt.subplots(figsize=(12, 9))
sns.heatmap(corrmat, vmax=.8, square=True)
# Create a DF of only numeric columns
df_num = df.select_dtypes(include=['int64', 'float64'])
corrmat = df_num.corr()
f, ax = plt.subplots(figsize=(12, 9))
sns.heatmap(corrmat, vmax=.8, square=True)
```
![correlations](images/correlation.png)

Loading…
Cancel
Save