I have a question about dividing Python categories.

Asked 2 years ago, Updated 2 years ago, 14 views

Thanks to the person who kindly answered my question earlier, in order to make a combined distribution table

However, since the presented categories are not consistent in spacing and can not be rounded up and categorized in a specific number of digits, I have no idea how to categorize them in this way of this. I'm asking if there's a method that's used to categorize columns like images because it's hard to find (maybe I'm not searching well) other than those cases through Google.

Just in case, I'll randomly create the original data!

python

2022-09-20 19:56

1 Answers

Try using pd.cut.


2022-09-20 19:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.