I am working on a dataset by WHO on Google Collab.
For some columns, 'data.loc' is working completely. For example:
data.loc[(data['Country'] == 'Bangladesh'), ['Country', 'Year', 'infant deaths']]
data.loc[(data['Country'] == 'Bangladesh'), ['Country', 'Year','Adult Mortality']]
However, there is a column called 'Life expectancy'. I have checked multiple times whether I mistyped or not. But every time I want to see columns having a 'Life expectancy' value for Bangladesh, I get an error message/response.
Code used:
data.loc[(data['Country'] == 'Bangladesh'), ['Life expectancy']]
Error Image:
My First 5 columns for better visualization of my dataset:
question from:
https://stackoverflow.com/questions/65941856/why-am-i-getting-an-error-while-using-data-loc-for-a-specific-column 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…