unnecessary = 'Australia, Austria, Belgium, Czech Republic, Denmark, Greece, Hungary, Iceland, Ireland, ' \
'Luxembourg, Mexico, Netherlands, New Zealand, Norway, Poland, Portugal, Slovak Republic, Spain, ' \
'Sweden, Switzerland, Turkey, Argentina, Brazil, Bulgaria, Chile, Cyprus, Estonia, Latvia, ' \
'Lithuania, Peru, Romania, Slovenia, South Africa, European Union, OECD - Total, Malaysia '
unnecessary = [i for i in unnecessary.split(', ')]
for key in df.Country.unique():
if key in unnecessary:
df.drop(df.index[(df['Country'] == key)], axis=0, inplace=True)
print(df.groupby('Skills').agg(['max', 'min'])['Country'])
Skills max min
Achievement Orientation United States Canada
Achievement/Effort United States Canada
Active Learning United States Canada
Active Listening United States Canada
Adaptability/Flexibility United States Canada
... ... ...
Visualization United States Canada
Wrist-Finger Speed United States Canada
Writing United States Canada
Written Comprehension United States Canada
Written Expression United States Canada