Skip to content

TypeError: type of argument "df" must be one of (pandas.core.frame.DataFrame, pyspark.sql.dataframe.DataFrame); got NoneType insteadBug Report #1266

@calculus-ask

Description

@calculus-ask

Current Behaviour

python version: 3.9.6
ydata_profiling: 4.0.0 (install using PIP)

import pandas as pd
from ydata_profiling import ProfileReport, compare

df1 = pd.read_csv("C:/Downloads/new.csv")
df2 = pd.read_csv("C:/Downloads/new1.csv")

df1_rep = ProfileReport(df1, title="One")
df2_rep = ProfileReport(df2, title="two")

comparison_report = compare([df1_rep, df2_rep])
also tried with
comparison_report = df1_rep.compare(df2_rep)

TypeError: type of argument "df" must be one of (pandas.core.frame.DataFrame, pyspark.sql.dataframe.DataFrame); got NoneType instead

The Same code works fine in pandas_profiling package.
Please let me know if you need additional information.

Expected Behaviour

Reports needs to generated

Data Description

name, age, country, state
kris, 20, usa, texas

Code that reproduces the bug

import pandas as pd
from ydata_profiling import ProfileReport, compare

df1 = pd.read_csv("C:/Downloads/new.csv")
df2 = pd.read_csv("C:/Downloads/new1.csv")

df1_rep = ProfileReport(df1, title="One")
df2_rep = ProfileReport(df2, title="two")

comparison_report = compare([df1_rep, df2_rep])
also tried with
comparison_report = df1_rep.compare(df2_rep)

pandas-profiling version

4.0.0

Dependencies

numpy: 1.22.4
pandas: 1.5.3

OS

Window 10

Checklist

  • There is not yet another bug report for this issue in the issue tracker
  • The problem is reproducible from this bug report. This guide can help to craft a minimal bug report.
  • The issue has not been resolved by the entries listed under Common Issues.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions