<jupyter_start><jupyter_text>![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true)  Visualizing the DatasaurusIt is important to visualize data, as shown in [Anscombe's quartet](https://en.wikipedia.org/wiki/Anscombe%27s_quartet).We'll use <NAME>'s [datasaurus data set](http://www.thefunctionalart.com/2016/08/download-datasaurus-never-trust-summary.html) as an example. First we'll import the data using [pandas](https://pandas.pydata.org) and calculate some statistics.<jupyter_code>import pandas as pd
df = pd.read_csv('datasaurus.csv')
df.describe()<jupyter_output><empty_output><jupyter_text>Then let's visualize the dataset using [Plotly Express](https://plotly.com/python/plotly-express), and we can see why it is called the datasaurus.<jupyter_code>import plotly.express as px
px.scatter(df, 'x', 'y', title='Datasaurus')<jupyter_output><empty_output><jupyter_text>As well, we can add a trendline. Hover your mouse over the trendline to see the slope, y-intercept, and correlation.<jupyter_code>px.scatter(df, 'x', 'y', title='Datasaurus with Trendline', trendline='ols') # ordinary least squares trendline<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12982744453574363, 'fraction_numerical': 0.00657354149548069, 'mean_word_length': 7.066225165562914, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '172681', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 429, 'n_tokens_neox': 406, 'n_words': 93, 'path': 'notebooks/datasaurus.ipynb', 'repo_name': 'callysto/interesting-problems', 'size': '1224'}