sfu-db / dataprep

Open-source low code data preparation library in python. Collect, clean and visualization your data in python with a few lines of code.
http://dataprep.ai
MIT License
1.99k stars 203 forks source link

Division by zero when reporting on an empty DataFrame #851

Closed DavidToneian closed 2 years ago

DavidToneian commented 2 years ago

Describe the bug When passing an empty DataFrame to dataprep.eda.create_report, a ZeroDivisionError is raised without a clear explanation for the reason.

Especially when one does not realize the DataFrame is empty, this is a surprising outcome with little in the stacktrace hinting at the underlying problem.

To Reproduce

from dataprep.eda import create_report
import pandas

df = pandas.DataFrame()
create_report(df)

Expected behavior Either

Desktop (please complete the following information):

Additional context I'm happy to implement a fix, if you let me know which the resulting behavior should be.