4 ms·
Glad to, as I need to learn Pandas in more depth than I currently know. Also, I noticed something very very dangerous you did: .describe() will return a DataF
by llao 8y ago
Glad to, as I need to learn Pandas in more depth than I currently know.
Also, I noticed something very very dangerous you did:
.describe() will return a DataFrame with all those statistics. One column per numeric column of the input. One row per statistical value (like mean, std, etc). If you call .mean() on THAT DataFrame, you will get the mean of the statistical values per column, so e.g. the mean of columnA's count, mean, std, etc values. Definitely not what you want!
Instead, use either .mean() directly on your "data DataFrame" (not the one returned by .describe()). Or access the specific value from the result via .describe()['columnname']['mean'].