Answer the question
In order to leave comments, you need to log in
How to parse CSV in a specific order?
There is a goal to parse the CSV database in the following order:
There are three columns: name, phone number, order number. You need to go through the column of phone numbers, and if the number is in a certain list, then you need to take the data of the entire line where this number was.
My implementation:
wishlist = []
df = pandas.read_csv('db.csv', sep=';')
for number in df['phone_numbers']:
if number in wishlist:
print(f"{df{'user_name']}, {df['order_id']}, {df['phone_number']}")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question