Skip to main content

Save Data to CSV

Step 6: Save Data to CSV

# Define the output file path
output_file = 'processed_population_data.csv'

# Save the processed DataFrame to the CSV file
data_iso.to_csv(output_file, index=False)

# Inform the user that the file has been saved
print(f"Processed population data saved to '{output_file}'")