clothing-recommender icon indicating copy to clipboard operation
clothing-recommender copied to clipboard

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

Open khalid5454 opened this issue 5 years ago • 0 comments

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

khalid5454 avatar Jul 08 '19 08:07 khalid5454