python - pandas value_counts applied to each column -
I have a For example So I would know that the temp is irrelevant and the name is not interesting (always the same) The following code: will generate the following results : dataframe Many of them have no value at the CSV file, or they always have the same, in this way, I have to see
value_counts for each column quickly, how can I do this?
id, temporary, name 1 34, blank, mark 2 22, blank, mark 3 34, blank, number
df = pd.DataFrame (data = [[34, 'null', 'mark'], [22, 'null', 'mark'], [34, 'blank / pre>
in df.column: print "----% s ---"% c print df [c] .value_counts ()
---- ID --- 34 2 22 1 dtype: int64 ---- temp --- null 3 dtype: int64 ---- name --- Icon 3 dtype: int64
Comments
Post a Comment