def assign_naics(df):
    """
    Function to assign NAICS codes to each dataframe activity

    NAICS created in part using EIA-923 technical guidance
    see pg 10 of
    https://www.eia.gov/electricity/monthly/pdf/technotes.pdf

    :param df: df, a FlowByActivity subset that contains unique activity names
    :return: df with assigned Sector columns
    """

    # assign sector source name
    df['SectorSourceName'] = 'NAICS_2012_Code'

    # Coal Integrated Gasification Combined Cycle
    df.loc[df['Activity'] == 'CGCC', 'Sector'] = '221112'
    # Conventional Steam Coal
    df.loc[df['Activity'] == 'CSC', 'Sector'] = '221112'
    # Natural Gas Fired Combined Cycle
    df.loc[df['Activity'] == 'NGCC', 'Sector'] = '221112'
    # Natural Gas Steam Turbine
    df.loc[df['Activity'] == 'NGSC', 'Sector'] = '221112'
    # Other Gases
    df.loc[df['Activity'] == 'OG', 'Sector'] = '221112'
    # Petroleum Coke
    df.loc[df['Activity'] == 'PC', 'Sector'] = '221112'
    # Petroleum Liquids
    df.loc[df['Activity'] == 'PL', 'Sector'] = '221112'

    # Nuclear
    df.loc[df['Activity'] == 'NU', 'Sector'] = '221113'

    # Solar Thermal with or without Energy Storage
    df.loc[df['Activity'] == 'ST', 'Sector'] = '221114'

    # Municipal Solid Waste
    df.loc[df['Activity'] == 'MSW', 'Sector'] = '221117'
    # Other Waste Biomass
    df.loc[df['Activity'] == 'OWB', 'Sector'] = '221117'
    # Wood/Wood Waste Biomass
    df.loc[df['Activity'] == 'WB', 'Sector'] = '221117'

    # Other - specified in footnotes of source data
    # df.loc[df['Activity'] == 'OT', 'Sector'] = ''

    return df