Question: z = a_df['city'].value_counts().loc[lambda x : x>1] z.index.tolist() z = a_df.loc[(a_df['city'] == 'Chicago') | (a_df['city'] == 'Portland')| (a_df['city'] == 'Rochester')|(a_df['city'] == 'Houston')| (a_df['city'] == 'Jacksonville')|(a_df['city'] ==
z = a_df['city'].value_counts().loc[lambda x : x>1] z.index.tolist() z = a_df.loc[(a_df['city'] == 'Chicago') | (a_df['city'] == 'Portland')| (a_df['city'] == 'Rochester')|(a_df['city'] == 'Houston')| (a_df['city'] == 'Jacksonville')|(a_df['city'] == 'Columbus')| (a_df['city'] == 'New York')|(a_df['city'] == 'Jackson')| (a_df['city'] == 'Charleston')|(a_df['city'] == 'Springfield')] details_cities_with_multiple_airport = pd.DataFrame(details_cities_with_multiple_airport.groupby(['city'],as_index=False).sum().sort_values(by='cnt',ascending=True)) details_cities_with_multiple_airport
can someone simplify this code?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
