Actually it should be quite simple. I have a pd series bar['Barcode'] where I want to get filter eans (barcodes with 12, 13 or 14 digits) from. Using Regex i'm appending to a new list within a loop. How do I at the same time delete the rows from the original series?
bar = pd.read_csv("barcode.csv", header=0, sep=';', engine='python')
ean = []
for i in bar['Barcode']:
x = re.search("\d{12,14}", i)
if(x):
ean.append(x.group())
#bar.drop(bar['Barcode']==x.string, inplace=True)
print(ean)
The problem comes with the line that I commented out. This is not the right way to do it, but I don't know how what else is possible. Could you help me delete the rows?
Thanks in advance!