I want to create 3 dataframes (i.e., gs, test and train) from the following dictionary:
datasets = {
"gs": "gender_submission.csv",
"test": "test.csv",
"train": "train.csv"
}
Is it possible to create a for loop to achieve this?
Maybe is easy to import every dataset first (with the pandas.read_csv()
function) and then use pandas.concat()
(info) to put them toghether.
Then you can do something like:
listDataFrames=[]
for key in datasets:
listDataFrames.append(pd.read_csv(datasets[key]))