Python Code: import pandas as pd from collections import Counter df = pd.read_csv('sales_data_sample.csv') df[['COUNTRY', 'PRODUCTLINE']] df[['COUNTRY']].value_counts() list(df[['COUNTRY']].value_counts().index) df[['PRODUCTLINE']].value_counts() cnt_country = Counter(df['COUNTRY']) cnt_country.most_common() cnt_productline = Counter(df['PRODUCTLINE'])
Pages
- Index of Lessons in Technology
- Index of Book Summaries
- Index of Book Lists And Downloads
- Index For Job Interviews Preparation
- Index of "Algorithms: Design and Analysis"
- Python Course (Index)
- Data Analytics Course (Index)
- Index of Machine Learning
- Postings Index
- Index of BITS WILP Exam Papers and Content
- Lessons in Investing
- Index of Math Lessons
- Downloads
- Index of Management Lessons
- Book Requests
- Index of English Lessons
- Index of Medicines
- Index of Quizzes (Educational)
Tuesday, November 9, 2021
Two ways to get Frequency Based Order of Categorical Data (Python)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment