Spaces:
Running
Running
import pandas as pd | |
import pickle | |
# Convert DataFrame pickles to CSV | |
pickle_files = ['newdf3.pkl', 'predictorsscale.pkl', 'newpredictors.pkl', | |
'train_predictors_val.pkl', 'newfifa.pkl', 'df3scaled.pkl'] | |
for file in pickle_files: | |
try: | |
df = pd.read_pickle(file) | |
csv_file = file.replace('.pkl', '.csv') | |
df.to_csv(csv_file, index=True) | |
print(f"Converted {file} to {csv_file}") | |
except Exception as e: | |
print(f"Error converting {file}: {str(e)}") |