Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'<=' not supported between instances of 'str' and 'int' #6

Open
khalid5454 opened this issue Jul 8, 2019 · 0 comments
Open

'<=' not supported between instances of 'str' and 'int' #6

khalid5454 opened this issue Jul 8, 2019 · 0 comments

Comments

@khalid5454
Copy link

while running the cleaning data file

following code lines give an error

df2 = pd.read_csv(img_category_path, delim_whitespace= True, header=0, names=['category'])
df2['upper_lower'] = ['1' if i < 21 else '3' if i>36 else '2' for i in df2['category']]

ERROR=

TypeError Traceback (most recent call last)
in
----> 1 df2['upper_lower'] = ['1' if i <= 21 else '3' if i>36 else '2' for i in df2['category']]

in (.0)
----> 1 df2['upper_lower'] = ['1' if i <= 21 else '3' if i>36 else '2' for i in df2['category']]

TypeError: '<=' not supported between instances of 'str' and 'int'

Any Solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant