Generation

generate functionWed, 15 Mar 2023

There is the "sl" list and there is the "sw" list. Write code that will create a "data" dataframe with the values from "sl" in the first column and "sw" in the second column. The values in the lists are contained in the following format: [[-0.90068117] [-1.14301691] [-1.38535265] [-1.50652052] [-1.02184904] [-0.53717756] [-1.50652052] [-1.02184904] [-1.74885626] [-1.14301691]]

import pandas as pd from pandas import DataFrame sl = [[-0.90068117], [-1.14301691], [-1.38535265], [-1.50652052], [-1.02184904], [-0.53717756], [-1.50652052], [-1.02184904], [-1.74885626], [-1.14301691]] sw = [[1.], [1.], [1.], [1.], [1.], [1.], [1.], [1.], [1.], [1.]] data = {'SL': sl, 'SW': sw} print(pd.DataFrame(data))

Questions about programming?Chat with your personal AI assistant