question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RecursionError: maximum recursion depth exceeded while calling a Python object

See original GitHub issue

Describe 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10

github_iconTop GitHub Comments

4reactions
sbrugmancommented, Jan 20, 2021

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found