generate functionSat, 01 Apr 2023

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

for ite in iterations: inds = get_my_inds(ite) sdf = global_dataframe.iloc[inds] sdf['Iteration'] = ite sdf.to_csv('SubDF' + str(ite) + '.csv')

Questions about programming?Chat with your personal AI assistant