import pandas as pd """ Filter for the show matching between different countries option """ def same_country_filter(df, country_code_list): # FILTER COUNTRY if country_code_list != []: country_filtered_df = pd.DataFrame() for c in country_code_list: c_df = df[df["country"].str.contains(c, na=False)] country_filtered_df = pd.concat([country_filtered_df, c_df], ignore_index=False) df = country_filtered_df return country_filtered_df else: return df