The to_csv function in the Pandas library is used to save a DataFrame as a CSV file. This function can be used to write the DataFrame to a file and export the data in CSV format.
import pandas as pd
# Save the DataFrame to a file named 'data.csv'
df.to_csv('data.csv', index=False)