I am new to Python and am using it to run regressions. I get the following error:
TypeError: '>=' not supported between instances of 'list' and 'int'
when I try to create a subset of my data which contain Country names, continent (Asia, Americas, etc.), population, GDP per Capita, and Life Expectancy in years.
This is my code:
#makes the variables below numeric
pop = data.groupby('pop').size()
life = data.groupby('lifeExp').size()
gdp = data.groupby('gdpPercap').size()
#create a subset within the data used here
sub1=data[(['pop']>= 100001)]
I get the error after I run the last line. My pop variable (population) is a float variable, but I thought pop = data.groupby('pop').size() makes it numeric. Any help would be greatly appreciated.