def plant_data(dat):
    """
    Takes the first part of the dataframe from the CSV file from the tables included in BEIS_Electricity_Generation_Cost_Report, and returns a dataframe with powerplants as columns and each data as columns
    :param dat: Input dataframe from BEIS_Electricity_Generation_Cost_Report
    :return: Returns first part of table, which includes plant size, average load factor, efficiency and operating period with power plants as rows and columns as data about said power plants
    """

    characteristics = dat.loc[0:2].dropna(axis='columns').drop(['Unnamed: 1'], axis=1).transpose()  # Fills empty column names, deletes units, and transposes dataframe so that plants are as rows
    operating_period = dat.loc[9].dropna().drop(['Unnamed: 1']).transpose().to_frame()  # Transposes operating period and drops units

    dat = characteristics.merge(operating_period, left_index=True, right_index=True)  # Merges the two series together to form a single dataframe

    dat = dat.rename(index=str, columns = {0:"Plant_Size",1:"Average_Load_Factor",2:"Efficiency",9:"Operating_Period"})  # Rename columns
    return dat