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

后端 未结 5 1666
忘掉有多难
忘掉有多难 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:32

    I had the same error message when trying to use that conditional. What intrigued me was that the same command had run correctly on another notebook.

    The difference was in how I read the csv file. This was the troublesome one:

    df=pd.read_csv('data.csv')
    

    And when I put the decimal argument it worked:

    df=pd.read_csv('data.csv', decimal=',')
    

    Obviously, it'll depend on how your data is organized. ;)

提交回复
热议问题