I am trying to display the output of percentile distribution for each column as a dataframe as I want to export it to csv later.
I have simply looped all the columns like this :
for column in data:
print(data[column].describe([.01,.1,.2,.3,.4,.5,.6,.7,.8,.9,.99]))
However, I couldn't figure out how to do rest. Any help is hugely appreciated!
+Editing the main question with an additional query :
I also want to group my output by a column such as data.groupby(data['MARKET']).describe([.01,.1,.2,.3,.4,.5,.6,.7,.8,.9,.99]) However, I receive the error like "describe() takes 1 positional argument but 2 were given". How can I deal with this problem?
Sample data set:
d = {'col1': [1, 2, 3, 2, 1],
'col2': [3, 4, 5, 6, 7],
'country': ['TR', 'UK', 'UK' , 'TR', 'TR']};
df = pd.DataFrame(data=d)