generate functionFri, 31 Mar 2023

read the dataframe "global_dataframe" from csv file "Sum Dat.csv" get the absolute error between the columns "EVa" and "EVb" grouped by the column "TV" conserving the column "TV" transformed to string

def abs_error_by_tv(dataframe, string_tv): dataframe.loc[:,"error"] = dataframe.loc[:,"EVa"] - dataframe.loc[:,"EVb"] dataframe.loc[:,"error"] = abs(dataframe.loc[:,"error"]) return dataframe.pivot_table(index = string_tv, values = "error")

Questions about programming?Chat with your personal AI assistant