add indent support to to_json method · Issue #12004 · pandas-dev/pandas (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@phretor

Description

@phretor

Sometimes you just want to have a quick look at your data in IPython and having to_json to support indent (as both json.dumps and simplejson.dumps do) would be very handy.

A workaround, which however doesn't always work, is to do json.dumps(series.to_dict()), which unfortunately is annoying when you don't have a JSON-serializable type (e.g., numpy.bool_).

I'm leaving this here as a food for discussion.