0

I would like to create a comparison report showing histograms side-by-side as in the example using the variable "Ferritin" mentioned on https://ydata.ai/resources/advanced-data-visualisation-with-pandas-profiling.

Unfortunately, when I try to replicate the report the histograms are on a single-page:

Current Output: Hist Single-Page

Current Output: Hist Single-Page

Expected Output: Hist Side-by-Side

Expected Output: Hist Side-by-Side

Does someone now how to influence the histogram behavior?

I tried different versions of pandas-profiling and searching through the authors GitHub repo. But this did not solve the issue.

import ydata_profiling
ydata_profiling.__version__
# 'v4.1.0'

import pandas as pd
import numpy as np
from ydata_profiling import ProfileReport

df = pd.DataFrame(dict(
  Ferritin=np.random.normal(1,10,size=200)
))

df_new = pd.DataFrame(dict(
  Ferritin=np.random.normal(1,10,size=200)
))

original_report = ProfileReport(df, title="Original Data")
original_report.to_file("original_report.html")

transformed_report = ProfileReport(df_new, title="Transformed Data")
comparison_report = original_report.compare(transformed_report)
#comparison_report.to_file("original_vs_transformed.html")
comparison_report


Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
  • For anyone attempting to answer this question, it requires either `conda install -c conda-forge ydata-profiling` or `pip install -U ydata-profiling` as per [ydataai/ydata-profiling](https://github.com/ydataai/ydata-profiling) – Trenton McKinney Mar 13 '23 at 20:37

1 Answers1

0

Given the current implementation is not possible to replace the current visuals with the side-by-side experience that you are asking. The more recent version of the package from v3.8.0 onwards have an overlap visual experience instead.

Nevertheless, there is an old version of the package where your requirement is met v3.5.0 or v3.6.0.

pip install ydata-profiling==3.5.0

Hope this is helpful!

FabC
  • 26
  • 3