generate functionThu, 30 Mar 2023

Define an interger variable "NVEI" Define an interger variable "NNewInd" Define the dataframe "RdataFrame" with columns: - "absGap" - "dG1", "dG2", "dG3",etc. With "NVEI" columns. - "Id1","Id2","Id3", etc. With "NNewInd" columns. For the first index of "RdataFrame", in the columns "dG1", "dG2", etc. Put the information of the column "time" of "gKPI" Start a loop of 1000 "Sample" in "Samples", per each sample: - Get sub dataframe "SDFrame" componed by 10% of the indexes of "global_dataframe" choosen randomly. Store the list "Indexes" of indexes choosen transposed. - Call "KPI" for "SDFrame" as "sKPI". - Calculate absolute error, "absGap", and detailed error per "Volt" value, "detGap", between "sKPI" and "gKPI". - Store "absGap" and "detGap" in the dataframe "RdataFrame" in columns "aGap", "dG1", "dG2", "dG3",etc. - Store "Indexes" in the dataframe "RdataFrame" in the columns "Id1","Id2","Id3",etc.

NVEI = 4 NNewInd=2 RdataFrame=pd.DataFrame( {"absGap":[np.nan]*1000, "dG1":[np.nan]*1000, "dG2":[np.nan]*1000, "dG3":[np.nan]*1000, "dG4":[np.nan]*1000, "Id1":[np.nan]*1000, "Id2":[np.nan]*1000, "Id3":[np.nan]*1000, "Id4":[np.nan]*1000, } ) RdataFrame.loc[0,"dG1"]=gKPI.loc["time",1] for i in range(1000): SDFrame = global_dataframe.sample(frac=0.1) sKPI=KPI(SDFrame) absGap=abs(sKPI.loc["time",1]-gKPI.loc["time",1]) detGap=np.array(

Questions about programming?Chat with your personal AI assistant