Library / SDK
fbdesignpro/sweetviz avatar
fbdesignpro/sweetviz

Sweetviz: two-line EDA reports and what they cost you

Visualize and compare datasets, target values and associations, with one line of code.

3,127 stars286 forksPythonMIT

At a glance

What is it?
Sweetviz turns a pandas DataFrame into a self-contained HTML report with target analysis, dataset comparison and mixed-type associations. It is a fast first pass over unfamiliar data, but its target handling and environment assumptions set hard boundaries.
Who is it for?
Adopt Sweetviz if you want a shareable HTML EDA report in two lines and your target is boolean or numerical. Skip it if you need a categorical target, if you write reports into a custom filesystem such as Colab, or if you need a machine-readable profile rather than an HTML app.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 157 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The gap Sweetviz fills between df.describe() and a hand-built notebook

df.describe() gives you counts and quartiles per column. It does not tell you how those columns relate to a label, and it does not tell you whether your training frame and your test frame have drifted apart. Sweetviz targets exactly that middle ground. The README describes the goal as helping "quick analysis of target characteristics, training vs testing data, and other such data characterization tasks", and the three entry points map onto it: analyze() for one frame, compare() for two distinct datasets, compare_intra() for two slices of the same frame, such as male versus female rows. The audience is a data scientist or ML engineer at the start of a project who wants a visual summary they can open in a browser and send to a colleague, without writing plotting code for every column. The output is a single self-contained HTML file, so the recipient does not need Python installed. If your question is "what is in this dataset and does it look like the other one", Sweetviz is aimed at you. If your question is "will this model generalize", it is not.

What analyze(), compare() and compare_intra() actually produce

The mechanism is a report object plus a render call. analyze() returns a DataframeReport; show_html() writes it out. The README gives the signature directly: analyze(source, target_feat=None, feat_cfg=None, pairwise_analysis='auto', verbosity='default'). source accepts a DataFrame or a tuple of a DataFrame and a display name, so [my_df, "Training"] labels the report. target_feat marks one column as the target, and the report then shows how every other feature relates to it. feat_cfg takes a FeatureConfig object for manual type overrides, which matters because the library otherwise infers types on its own. The inference is described as automatic detection of numerical, categorical and text features. Associations are the part worth understanding: the README states that Sweetviz combines Pearson's correlation for numerical pairs, the uncertainty coefficient for categorical pairs, and the correlation ratio for categorical-numerical pairs, so a single association view covers mixed types instead of forcing you to pick one coefficient and drop the rest. Each feature also gets summary statistics. The README lists type, unique values, missing values, duplicate rows and most frequent values, plus min/max/range, quartiles, mean, mode, standard deviation, sum, median absolute deviation, coefficient of variation, kurtosis and skewness for numerical columns. That is a wide but shallow profile: it describes each column and its pairwise link to the target, not interactions among three or more features.

Installing Sweetviz and the import errors the README expects

Installation is a single pip command: pip install sweetviz. The README states support for Python 3.6+ and pandas 0.25.3+. Upgrading gets its own section because the author reports mixed results updating through pip, and recommends pip uninstall sweetviz first, then reinstalling. Two failure modes are documented by name: ModuleNotFoundError: No module named 'sweetviz' and AttributeError: module 'sweetviz' has no attribute 'analyze'. The first suggested cause is a script in your own project named sweetviz.py, which shadows the library; the README says to delete or rename it and any associated .pyc files. The other suggestions are a clean reinstall and checking for multiple Python installations or OS permission problems, with three Stack Overflow links offered as references. Treat that list as the maintenance tax on this package: the author wrote it because the errors recur. The basic call pattern is short. import sweetviz as sv, then my_report = sv.analyze(my_dataframe), then my_report.show_html(), which the README says defaults to generating SWEETVIZ_REPORT.html. Rendering has both html and notebook report options plus scaling, and the README notes version 2.0 added Jupyter and Colab support along with report scaling and vertical layout.

The target_feat restriction is the sharpest edge in the library

The README is explicit: target_feat is a string naming the feature to mark as target, and "Only BOOLEAN and NUMERICAL features can be targets for now." That sentence removes a large share of ordinary use cases. Multi-class classification with a string label is out. So is any target stored as a category dtype or a text column, which is the default shape of a lot of raw data before encoding. You can work around it by encoding the label to integers first, but then the report's target view describes the encoded column, and the per-value breakdown is whatever your encoding produced. There is no statement in the material that a future release lifts this restriction, so plan around it rather than waiting. The second constraint is environmental: the README says reports are output using the base os module, and that custom environments such as Google Colab which require custom file operations "are not yet supported", though the author says a solution is being looked into. Version 2.0 is credited with Jupyter and Colab notebook support, so the notebook display path exists while the file-writing path is the part flagged as unsupported. If your pipeline runs somewhere with a virtual or remote filesystem, verify show_html() before building anything on top of it.

Where Sweetviz stops and ydata-profiling starts

The closest widely used alternative is ydata-profiling, formerly pandas-profiling. The difference is in the output contract, not the feature list. Sweetviz produces a self-contained HTML application built around one job: relating features to a target and contrasting two datasets. The README's own framing is target analysis and comparison, with the report rendered through show_html() or a notebook equivalent. ydata-profiling produces a per-column profile as its primary artifact, with a dataset overview and a warnings section, and it can emit that profile as JSON, so the result can be consumed by a script rather than only read by a person. If you need a machine-readable artifact for a pipeline check, or you want per-column alerts about skew, high cardinality or constant columns, Sweetviz's HTML report is the wrong shape. If you specifically want to see how each feature behaves against a label, and to put a training set next to a test set, Sweetviz's compare() and target view are more direct than assembling the same comparison from a profiling report. Neither library does causal analysis, and neither replaces plotting the specific relationships your model depends on.

Release cadence, licence and what upgrading costs

The release history in the material is uneven. v2.3.1 is dated 2023-11-29. v2.3.2, labelled "Long-standing fixes", is dated 2026-04-05, and v2.3.3, labelled "Fixes for graphs cut off in some cases", is dated 2026-04-11. The README banner announces the April 2026 update as version 2.3.2 with long-standing issues fixed, so the gap between 2.3.1 and 2.3.2 is roughly two and a half years. That pattern matters for planning: a project that sits idle for years and then ships two patch releases in a week is likely to accumulate small breakages against newer pandas and numpy versions between bursts. The README already points to version 2.2 as a compatibility update for Python 3.7+ and newer numpy. Budget for a reinstall-and-verify step when you move Python or pandas, and use the documented sequence (pip uninstall sweetviz, then pip install sweetviz) rather than an in-place upgrade, since the README reports mixed results with the latter. The licence is MIT, which permits commercial and closed-source use and modification provided the copyright notice and permission notice are retained; that is a plain statement of what MIT says, not legal advice, and you should confirm the LICENSE file in the repository matches before relying on it.

Who should run sv.analyze() first, and who should not

Sweetviz fits the first hour of a tabular project. You have a DataFrame, you want to know which columns carry signal against a boolean or numeric label, and you want to hand the same picture to a teammate who does not run Python. Two lines get you there, and the HTML file is portable. It also fits the train/test check, where compare() puts two frames side by side and surfaces distribution differences before you waste a training run. It does not fit three situations. First, a categorical or text target, because the README limits targets to boolean and numerical. Second, an environment where the report must be written through something other than the base os module, because the README names Colab-style custom file operations as unsupported. Third, a need for a programmatic artifact, since the deliverable here is an HTML app rather than structured output. There is also a scaling question the README does not answer: nothing in the material states how report generation behaves on wide frames or on frames with many unique categorical values, so test on a sample of your own data before pointing it at a full table. The concrete first step is pip install sweetviz, then sv.analyze(df) on a slice with a boolean or numeric target, then open the generated SWEETVIZ_REPORT.html and check that the association view is computing on the columns you expected rather than on inferred types you did not intend.

Editorial conclusion

Adopt Sweetviz if you want a shareable HTML EDA report in two lines and your target is boolean or numerical. Skip it if you need a categorical target, if you write reports into a custom filesystem such as Colab, or if you need a machine-readable profile rather than an HTML app. Before committing, run pip install sweetviz on your actual Python and pandas versions, call sv.analyze(df) on a frame that contains a categorical target column, and confirm show_html() writes a file in your environment; the README's own troubleshooting list is the place to start if the import fails.

Official sources

  1. fbdesignpro/sweetviz on GitHub
  2. Issues
  3. License: MIT
  4. README
  5. Releases
Community notes

Community notes