Complete the code to export the DataFrame to a CSV file named 'data.csv'.
df.to_csv([1])To save a DataFrame as a CSV file, use to_csv with the filename ending in '.csv'.
Complete the code to export the DataFrame to an Excel file named 'report.xlsx'.
df.to_excel([1])Use to_excel with a filename ending in '.xlsx' to export to Excel format.
Fix the error in the code to export the DataFrame to a JSON file named 'data.json'.
df.[1]('data.json')
The correct method to export a DataFrame to JSON is to_json.
Fill both blanks to export only the 'Name' and 'Age' columns to a CSV file named 'subset.csv'.
df.loc[:, [[1], [2]]].to_csv('subset.csv', index=False)
Use loc to select columns 'Name' and 'Age' before exporting.
Fill all three blanks to export rows where 'Score' is greater than 80 to a JSON file named 'high_scores.json'.
df_filtered = df[df[[1]] [2] [3]] df_filtered.to_json('high_scores.json')
Filter rows where 'Score' > 80, then export filtered DataFrame to JSON.