text_html_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

districts_df = pd.read_csv('../input/learnplatform-covid19-impact-on-digital-learning/districts_info.csv')
products_df = pd.read_csv('../input/learnplatform-covid19-impact-on-digital-learning/products_info.csv')

products_df = products_df[products_df['Sector(s)'].notna()]

products_df['primary_function_main'] = products_df['Primary Essential Function'].apply(lambda x: x.split(' - ')[0] if x == x else x)
products_df['primary_function_sub'] = products_df['Primary Essential Function'].apply(lambda x: x.split(' - ')[1] if x == x else x)
products_df.drop('Primary Essential Function', axis=1, inplace=True)

products_df.head()