I wonder if there is a way to search a list of keywords using Python. I am able to search though my data using PostgreSQL. Here is my PostgreSQL code
SELECT distinct ON (id) id, year, cost, description
FROM mydata
WHERE description similar to'%((hotel)||(travel)|(taxi)|(food))%';
I don't know if Python is the best way to do it, but the work that I am replicating uses Python and would like to stick with Python.
I was able to search one keyword but am not sure how to do multiple.
import csv
with open('mydata.csv', 'r') as f:
for line in f.readlines():
if 'food' in line:
print(line)
I need help with
1) searching using multiple keywords
2) way to export the data back to csv