I am trying to extract information from a number of countries from a dataset I downloaded. I was able to figure out how to pull one country, but have had syntax errors trying to pull more than one in the same line. Here it is with the output:
ef=df1.loc[df1['countries'] == 'Hong Kong']
print(ef)
year ISO_code countries ECONOMIC FREEDOM rank quartile \
2016 HKG Hong Kong 8.97 1.0 1.0
2015 HKG Hong Kong 8.97 1.0 1.0
2014 HKG Hong Kong 9.00 1.0 1.0
2013 HKG Hong Kong 8.96 1.0 1.0
2012 HKG Hong Kong 8.96 1.0 1.0
Can someone explain how I pull multiple countries in the same line of code? Also, am I able to output this information into a separate .csv file?
Thanks for your help.