Comments (5)
Yes today you have to convert to/from json which has lots of problems.
This PR: #37 adds pandas and arrow dataframe support, but I had put it on hold for other work. I've wrapped up those other tasks so this is like the next PR / feature I will be working on in the near future to get released.
from scrapbook.
This functionality was merged to master last week, just not released yet -- it uses pyarrow to encode the dataframe in master which is a little better than the to_dict and from_dict.
from scrapbook.
If you look at this file: https://github.com/nteract/scrapbook/blob/master/scrapbook/encoders.py
arrow is commented out for some reasons.
from scrapbook.
Just a quick note here - couldn't this be relatively quickly solved by using an encoder such as this:
class DataFrameEncoder(object):
def encode(self, scrap):
# scrap.data is any type, usually specific to the encoder name
scrap = scrap._replace(data=scrap.data.to_dict())
return scrap
def decode(self, scrap):
# scrap.data is one of [None, list, dict, *six.integer_types, *six.string_types]
scrap = scrap._replace(data=pd.DataFrame.from_dict(scrap.data))
return scrap
encoder_registry.register('pandas', DataFrameEncoder())
This allows me to do sb.glue('mydf', 'df', 'pandas')
Maybe not very edge-casey and elegant, but could be a start?
from scrapbook.
In this PR #62 (closing as the issue should be resolved)
from scrapbook.
Related Issues (20)
- 0.3.0 Release HOT 2
- Python 3 only release change
- Incompatible with JupyterLab HOT 2
- Possible to use with figures / plots? HOT 6
- Error message: Mime type unknown is not currently supported HOT 2
- Scrap of type Int not supported HOT 2
- Pandas DataFrame example raises error "No encoder found " HOT 2
- Importing ABC directly from collections was deprecated and will be removed in Python 3.10
- Highlight demo fails on Binder with KeyError: "kernel_manager_class" HOT 6
- Remove papermill dependency
- Python 3.9 compatibility HOT 3
- All old versions have been dropped from pypi? HOT 4
- Cool project, however, some suggestions for improvements HOT 2
- Authorize filter arguments to filter notebook to read given their name HOT 1
- Reverse operation for `glue` HOT 2
- What happened to pm.display? HOT 4
- scrap.Scrap as a dataclass
- Issue with scrapbook glue in R ipynb:
- Encoder abstract class and `pickle`/`dill` encoders
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrapbook.