I guess I am running into a beginner problem: -> I want to loop over an array and insert the the values into lines of code that are executed. For the attempt below I get "SyntaxError: can't assign to operator"
#Country-subsets (all countries in dataframe)
for s in country_filter:
s.lower() + '_immu_edu' = immu_edu.loc[immu_edu['CountryName'] == s]
Thanks for helping!
My expected output would be:
guinea_immu_edu = immu_edu.loc[immu_edu['CountryName'] == "Guinea"]
lao_immu_edu = immu_edu.loc[immu_edu['CountryName'] == "Lao PDR"]
bf_immu_edu = immu_edu.loc[immu_edu['CountryName'] == "Burkina Faso"]
us_immu_edu = immu_edu.loc[immu_edu['CountryName'] == "United States"]
ge_immu_edu = immu_edu.loc[immu_edu['CountryName'] == "Germany"]