How to order a dataset

Asked

Viewed 253 times

-1

I’m trying to sort the numerical values of a dataset in ascending order using :

df.sort_values(by=['radius_mean'], axis=0)

But I would like to sort all the columns in ascending order and not sort according to just one of the columns, someone would have some method that solves itself?

1 answer

1


It’s a strange demand! Theoretically a table with row records should keep the column data for each row. The way you want it, you will treat each column as independent data.

But going for solution, you could use the following code:

for c in df.columns:
     df[c] = sorted(df.loc[:,c])
  • 1

    thanks for the help , it worked , ! back always +) kkk

Browser other questions tagged

You are not signed in. Login or sign up in order to post.