Sind Werte aus Dataframe1 in Dataframe 2 enthalten?
Verfasst: Sonntag 5. Dezember 2021, 17:28
Hello,
I have two dataframes and would like to know if values from dataframe1 are included in dataframe 2.
My dataframes look something like the following:
'Holidays_he = {'holiday': ['Whit Monday','Epiphany', 'summer vacation', 'summer vacation'],
'date': [datetime.date(2020-06-10),
datetime.date(2020-06-20),
datetime.date(2020-07-01),
datetime.date(2020-07-02)]}
Holidays_he_df = pd.DataFrame(Holidays)
Flights = {'route': ['SXF-STN','SXF-STN','STNSXF','STNSXF'],
'date': [datetime.date(2020-06-11),
datetime.date(2020-06-20),
datetime.date(2020-08-01),
datetime.date(2020-07-02)]}
Flights _df = pd.DataFrame(Flights )
I would now like to create a new column in Flights_df that will output to me in 0's and 1's whether or not there were holidays on the day of the flight.
Thanks in advance for your help.
I have two dataframes and would like to know if values from dataframe1 are included in dataframe 2.
My dataframes look something like the following:
'Holidays_he = {'holiday': ['Whit Monday','Epiphany', 'summer vacation', 'summer vacation'],
'date': [datetime.date(2020-06-10),
datetime.date(2020-06-20),
datetime.date(2020-07-01),
datetime.date(2020-07-02)]}
Holidays_he_df = pd.DataFrame(Holidays)
Flights = {'route': ['SXF-STN','SXF-STN','STNSXF','STNSXF'],
'date': [datetime.date(2020-06-11),
datetime.date(2020-06-20),
datetime.date(2020-08-01),
datetime.date(2020-07-02)]}
Flights _df = pd.DataFrame(Flights )
I would now like to create a new column in Flights_df that will output to me in 0's and 1's whether or not there were holidays on the day of the flight.
Thanks in advance for your help.