'>' not supported between instances of 'str' and 'int'

后端 未结 5 1670
忘掉有多难
忘掉有多难 2021-01-13 16:02

I encountered the error

\'>\' not supported between instances of \'str\' and \'int\'

while trying to print the below lines in P

5条回答
  •  温柔的废话
    2021-01-13 16:21

    First make sure that all value of survey_df_clean['text'] is the same, if you want to convert as numeric, do this :

    survey_df_clean['text'] = pd.to_numeric(survey_df_clean['text'])
    

    Then do this

    survey_df_clean.loc[survey_df_clean['text']>30].shape
    

提交回复
热议问题