RecursionError: maximum recursion depth exceeded while calling a Python object
See original GitHub issueDescribe the bug
I got this error when trying to get a report on a file with around 250k rows and a couple of thousand columns. I managed to in the end reproduce the error with this minor dataframe. Removing any of the 6 values removes the error.
To Reproduce
import numpy as np
import pandas as pd
from pandas_profiling import ProfileReport
test = pd.DataFrame(
[0,5,22,32,65,np.nan],
columns=['a']
)
profile = ProfileReport(test)
profile.to_html()
Version information:
- Python version: 3.7.5
- Environment: Azure Databricks notebook (in a Jupyter Notebook in VSCode it just keeps running)
- pip list:
numpy: 1.18.1
pandas: 1.2.0
pandas-profiling: 2.10.0
Additional context
I tried increasing the sys.setrecursionlimit(1500)
in Python, but that doesn’t seem to help either.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10
Top Results From Across the Web
maximum recursion depth exceeded while calling a Python ...
This means that each call to your recursive function will create a function call stack and because there is a limit of stack...
Read more >Python RecursionError: Maximum Recursion Depth Exceeded ...
A Python RecursionError exception is raised when the execution of your program exceeds the recursion limit of the Python interpreter.
Read more >Python maximum recursion depth exceeded in comparison
The “maximum recursion depth exceeded in comparison” error is raised when you try to execute a function that exceeds Python's built in recursion ......
Read more >maximum recursion depth exceeded while calling a Python ...
When we run the recursion function for a large number of times, recursion error is thrown. Python has a limit on the number...
Read more >RecursionError: maximum recursion depth exceeded #3365
Describe the bug I am trying to serialize a SageMaker step. I am using dill as a replacement for pickle but they both...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed this issue just now in the typeset. Numerical values with few distinct values are considered categorical, there was an edge case bug that would result in this infinite loop. Thanks for thinking along.
The fix will be in the next release (soon).
I’m guessing this is the fix: https://github.com/pandas-profiling/pandas-profiling/pull/674/commits/1a3bffb724cdca35799843ef6915636985a08374
Here is the branch containing this fix: https://github.com/pandas-profiling/pandas-profiling/tree/fixes-2.10.0