Open JamesMDorame opened 3 years ago
Here is more information for this bug.
When trying to generate a report the following error occurs: AbstractMethodError: This method must be defined in the concrete class type
Environment Windows 10 Python 3.7 jupyter notebook numpy 1.16.2 pandas-profiling 2.10.0 PackageList.txt PackageManager.txt
Code to reproduce:
import numpy as np import pandas_profiling df = pd.DataFrame( np.random.rand(100, 5), columns=["a", "b", "c", "d", "e"] ) pandas_profiling.ProfileReport(df)
AbstractMethodError Traceback (most recent call last)
Information added to comment on issue. Thank you
On Wed, Feb 3, 2021 at 8:03 AM Simon Brugman notifications@github.com wrote:
Could you provide the minimal information to reproduce this error? This guide http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports can help crafting a minimal bug report.
-
the minimal code you are using to generate the report
which environment you are using:
- operating system (e.g. Windows, Linux, Mac)
- Python version (e.g. 3.7)
- jupyter notebook, console or IDE such as PyCharm
- Package manager (e.g. pip, conda conda info)
- packages (pip freeze > packages.txt or conda list)
a sample or description of the dataset (df.head(), df.info())
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pandas-profiling/pandas-profiling/issues/685#issuecomment-772533784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFTLXNLXY6RSFXRHJUFQ723S5FJUXANCNFSM4W5ILD6A .
Thanks @JamesMDorame. The issue in your environment seems to be with the code below, although I could not reproduce it. Could you please verify that the following snippet yields the same error:
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.rand(100, 5), columns=["a", "b", "c", "d", "e"])
df.columns = df.columns.astype('str')
print(df)
print(df.columns)
(most likely the pandas dependency is outdated)
That code does not return the error.
Abbreviated output 91 0.367833 0.188482 0.658861 0.485134 0.400419 92 0.624880 0.229420 0.591141 0.094314 0.523189 93 0.231544 0.340217 0.738064 0.472836 0.838604 94 0.586591 0.479526 0.074745 0.643456 0.519543 95 0.524571 0.471131 0.256094 0.456682 0.564187 96 0.860796 0.816732 0.590780 0.325540 0.619459 97 0.324934 0.872229 0.843747 0.316590 0.683571 98 0.795500 0.579887 0.371556 0.363243 0.177154 99 0.283282 0.459053 0.546533 0.257715 0.667444
[100 rows x 5 columns] Index(['a', 'b', 'c', 'd', 'e'], dtype='object')
Based on the stack trace and the code I can't find a clear reason why this is happening. Any help to track down the root cause is appreciated.
Describe the bug
To Reproduce
**Version information:**Additional context