-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Use df.to_json(orient='table')
#8
base: master
Are you sure you want to change the base?
Conversation
jupyterlab_table/utils.py
Outdated
return data.to_dict(orient='records') | ||
if isinstance(data, pd.DataFrame): | ||
data = sanitize_dataframe(data) | ||
data = data.to_json(orient='table') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
jupyterlab_table/utils.py
Outdated
data = sanitize_dataframe(data) | ||
return data.to_dict(orient='records') | ||
if isinstance(data, pd.DataFrame): | ||
data = sanitize_dataframe(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the sanitization code end up in pandas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sanitize_dataframe
code comes from the original jupyterlab_vega which used to_dict(orient='records')
. I think that to_json
should take care of our sanitization needs?
df.to_json(orient='table')
df.to_json(orient='table')
Depends on pandas 0.20.0: pandas-dev/pandas#14904