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?
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)))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.