I found three questions giving a basis but I couldn't create a code for this work, I would like some help because I really couldn't create and I think it can be very useful for other people in the future. I'll leave the three questions I tried to work on:
Filter rows in csv file based on another csv file and save the filtered data in a new file
Python how to search value in one csv based on another csv - pandas?
Python: Filtering CSV with conditions from another CSV
Data explanation:
CSV
file name "Main.csv"
:
label,value,market
,,
team1 v team2,match1,market1
team3 v team4,match2,market2
team5 v team6,match3,market3
CSV
file name "parameter.csv"
: used as a parameter for the filter:
time,goals,label,value
,,,
15,4,team1 v team2,match1
10,3,team5 v team6,match3
RULE: If the value of
label
andvalue
are found exactly together in a row, so be present in theCSV
final!
CSV
expected and created after filter:
label,value,market
,,
team1 v team2,match1,market1
team5 v team6,match3,market3