4

I have a pandas pf with these types:

id                   14 non-null int64
class                14 non-null int64
action.start         6 non-null float64
action.end           6 non-null float64
action.text          6 non-null object
action.lemma         6 non-null object

When I run df.to_json('output.json',orient='index') (tried any orient option) it keeps crashing and with the error:

OverflowError: Maximum recursion level reached

Any ideas how to resolve this?

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
Roy Granit
  • 325
  • 2
  • 20

1 Answers1

4

Turns out I had some weird object type in the dataframe:

action.text <class 'spacy.tokens.span.Span'>

Turning this into text solved the issue

Roy Granit
  • 325
  • 2
  • 20