Skip to content

Latest commit

 

History

History
108 lines (52 loc) · 2.48 KB

plot_bivariate_categorical_numeric_summary.rst

File metadata and controls

108 lines (52 loc) · 2.48 KB
.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_auto_examples_bivariate_summaries_plot_bivariate_categorical_numeric_summary.py>`
        to download the full example code

.. rst-class:: sphx-glr-example-title

Bivariate Categorical-Numeric Summary

Example of bivariate eda summary for a categorical independent variable and a numeric dependent variable.

The summary computes the following:

  • Overlapping histogram/kde plots of distributions by level
  • Side by side boxplots per level
import pandas as pd
import plotly

import intedact

Here we look at how diamond price changes with cut quality

data = pd.read_csv(
    "https://raw.githubusercontent.com/mwaskom/seaborn-data/master/diamonds.csv"
)
data["cut"] = pd.Categorical(
    data["cut"],
    categories=["Fair", "Good", "Very Good", "Premium", "Ideal"],
    ordered=True,
)
fig = intedact.categorical_numeric_summary(data, "cut", "price", fig_width=700)
plotly.io.show(fig)
.. rst-class:: sphx-glr-timing

   **Total running time of the script:** ( 0 minutes  1.243 seconds)


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example



  .. container:: sphx-glr-download sphx-glr-download-python

     :download:`Download Python source code: plot_bivariate_categorical_numeric_summary.py <plot_bivariate_categorical_numeric_summary.py>`



  .. container:: sphx-glr-download sphx-glr-download-jupyter

     :download:`Download Jupyter notebook: plot_bivariate_categorical_numeric_summary.ipynb <plot_bivariate_categorical_numeric_summary.ipynb>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_