generate functionSat, 01 Apr 2023

dataframe "global_dataframe". "Inds"=[0,2,15,166,1587] "Iterations" =[0,1,2,3,4] For each "Ite" in "Iterations" - Add a column called "Iteration" to a subdataframe "SDF" with the values of "global_dataframes" in the indexes "Inds" and "Ite" for all 5 indexes of "SDF". - print the value of "SDF" to a csv file called "SubDF" + "Ite" + ".csv".

def SDF(global_dataframe, Inds, Iterations): for Ite in Iterations: SDF = global_dataframe.iloc[Inds, Ite] outpath = r'Path'+'SubDF'+str(Ite)+'.csv' SDF.to_csv(outpath)

Questions about programming?Chat with your personal AI assistant