Select a specific row based on the value of a column in the DataFrame

DF of the original data:


At this point, I want to select the sample row whose column name isInfected is "HFMD":


Summary: Select all rows in the DataFrame where a column is equal to a certain value, and use one command to solve that:

df.loc[df['columnName']=='the value']

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325981882&siteId=291194637