raw=pd.read_csv('raw_6_12_8_30.csv')
raw2=raw.loc[raw['spices'].isnull()==False] # code for deleting 10 values #
b=[]
for i in range(len(raw2)):
if raw2['Status'][i]==0: # codes didn't run perfectly#
print(i)
But when I use this code without line 2, it works fine.
raw=pd.read_csv('raw_6_12_8_30.csv')
b=[]
for i in range(len(raw)):
if raw['Status'][i]==0:
print(i)
I checked there is no errors in this raw2['Status] and raw['Status']
But whenever I use pandas.loc ,there is an error.
I bet that line 2 makes an error but I don't know why?
error images here enter image description here
key errors 11 # what is it #
for i in range(len(raw)), what values willihave? Now, you are using the values like so:raw['Status'][i]. Does that make sense? How many things are inraw? How many things are inraw['Status']? Do you expect those answers to be the same? Why?