Real-World Problem (Calculation from Several Groups):- What percentage of people from each country know Python?country_respondents = df['Country'].value_counts()country_uses_python = country_grp['LanguageWorkedWith'].apply(lambda x: x.str.contains('Python').sum())result = pd.concat([country_respondents, country_uses_python], axis='columns')result.rename(columns={'Country': 'NumRespondents', 'LanguageWorkedWith': 'NumKnowsPython'})result['PctKnowsPython'] = country_uses_python / country_uses_python * 100result.sort_values(by='PctKnowsPython', ascending=False)result.loc['Japan'](00:33:36 - 00:45:23)
Python Pandas Tutorial (Part 8): Grouping and Aggregating - Analyzing and Exploring Your Data
Corey Schafer
※本サイトに掲載されているチャンネル情報や動画情報はYouTube公式のAPIを使って取得・表示しています。
Timetable
動画タイムテーブル
動画数:236件