<jupyter_start><jupyter_text>Writing data frame to a file<jupyter_code>import seaborn as sns
import pandas as pd
diamonds_df = sns.load_dataset('diamonds')
diamonds_df.to_csv('diamonds_modified.csv')


print(diamonds_df.head())
diamonds_df.to_csv('diamonds_modified.csv', index=False)
#Find the diamonds_modified.csv in the src directory<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1008174386920981, 'fraction_numerical': 0.0, 'mean_word_length': 9.222222222222221, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '86129', 'license': 'MIT', 'n_tokens_mistral': 143, 'n_tokens_neox': 131, 'n_words': 26, 'path': 'Lesson01/Exercise07.ipynb', 'repo_name': 'TrainingByPackt/Interactive-Data-Visualization-with-Python', 'size': '367'}