silent_hunter
silent_hunter

Reputation: 2508

Estimations skewness coefficients

My set contain categorical and numerical values. So I am try to estimate skewness coefficients only for numerical values in my data set. In order to do that I wrote this line of code

dataset_num = dataset.select_dtypes(include = ['float64', 'int64'])

But now I want to see what is skewness coefficients for each 8-variables which is selected by code above.I try with this line of code but I this dont work properly.

print("Skewness: %f" % dataset_num.skew())

So can anybody help me how to solve this problem and estimate skewness for each 8-variables ?

Upvotes: 0

Views: 57

Answers (1)

Yefet
Yefet

Reputation: 2086

dataset_num.skew() return a pandas.core.series.Series hence you cant use %f , you can try print the whole series

print("Skewness: \n", dataset_num.skew())

if you want better looking print with key value pairs you can do the following:

print("Skewness: \n", list(zip(dataset_num.skew().index,dataset_num.skew().values)))

Upvotes: 1

Related Questions