Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

Issue with scrapbook glue in R ipynb: #90

Description

@booysej

Hi,

I am running scrapbook to persist a pandas dataframe from an R ipynb using the code below:
I created an identical python notebook that works, it just seems to break as per below...
Any ideas, i would love to run my R and python notebooks with papermill and
persist the return values with scrapbook

------------- Notebook Using R ipynb kernel and R reticulate to sseemlessly use python ---------

library("reticulate")
use_condaenv("kitchen-nb")
pd <- import("pandas")
py_config()
sb <- import("scrapbook", convert = T)

python: /Users/jacques/opt/anaconda3/envs/kitchen-nb/bin/python
libpython: /Users/jacques/opt/anaconda3/envs/kitchen-nb/lib/libpython3.7m.dylib
pythonhome: /Users/jacques/opt/anaconda3/envs/kitchen-nb:/Users/jacques/opt/anaconda3/envs/kitchen-nb
version: 3.7.0 | packaged by conda-forge | (default, Nov 12 2018, 12:34:36) [Clang 4.0.1 (tags/RELEASE_401/final)]
numpy: /Users/jacques/opt/anaconda3/envs/kitchen-nb/lib/python3.7/site-packages/numpy
numpy_version: 1.21.6
pandas: /Users/jacques/opt/anaconda3/envs/kitchen-nb/lib/python3.7/site-packages/pandas

start <- 1
end <- 10
result <- iris[start:end, ]
result <- r_to_py(result) # will convert R data frame to pandas data frame... 
sb$glue("result", result, encoder <- "pandas")
result

--------- Then later from Python Code I am trying ------------

nb = scrapbook.read_notebook("mnt/wolfstack/notebooks/output-notebook-1-5.ipynb")
nb.scraps

It returns: (nothing)
Scraps()

Jacques

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions