1
$\begingroup$

I have been working on a project which i took from kaggle. I didn't get the result as mentioned in the website. What am I doing wrong here?

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns

train = pd.read_csv('../data/dont-overfit/train.csv')
test = pd.read_csv('../data/dont-overfit/test.csv')

train[train.columns[2:]].std().plot('hist')

train[train.columns[2:]].mean().plot('hist')
plt.title('Distribution of means/stds of all columns')

plt.show()

print(train.isnull().any().any())

print('Distribution of first 28 columns')
plt.figure(figsize=(26,24))
for i, col in enumerate(list(train)[2:30]):
    plt.subplot(7, 4, i+1)
    plt.hist(train[col])
    plt.title(col)

plt.show()

Here is the post

| improve this question | | | | |
$\endgroup$
  • $\begingroup$ The link you provided is not working. $\endgroup$ – Ankit Seth Aug 1 '19 at 6:16
  • $\begingroup$ @AnkitSeth updated the link $\endgroup$ – Alexpandiyan Chokkan Aug 1 '19 at 6:18
  • $\begingroup$ You are trying to plot the distribution of first 28 column and it doesn't match with result as mentioned in website. Code looks okay to me. Is there any change in dataset you have download. $\endgroup$ – SUN Aug 1 '19 at 7:30
1
$\begingroup$

the code seems ok plotting the distribution. let me know the exact error.

enter image description here

| improve this answer | | | | |
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.