You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: