### Bug description

When using ojs_define with Python and pandas, it is not possible to pass an instance of pd.Series, while it is possible to do so for a pd.Dataframe. If a series is passed, ojs_define produces a type error and stops the render:
`TypeError: Object of type Series is not JSON serializable`

In order for ojs_define to work, the series need to be converted to dataframes first which is cumbersome (series get used really often). For a better pandas-ojs integration it would be beneficial to include pd.Series support in ojs_define such as it is done for pd.Dataframe, or at least to produce a more meanigful error description, pointing to the need to convert to a dataframe. 

Minimal working example: 

````
---
title: "ojs_define"
format: html
jupyter: python3
---
```{python}
import pandas as pd 
my_variable = pd.Series([0,1,2,3])
# ojs_define(my_variable = pd.DataFrame(my_variable)) # this works
ojs_define(my_variable = my_variable) # this doesn't
```
```{ojs}
my_variable
```
````

### `quarto check` Output

[>] Checking Quarto installation......OK
      Version: 1.0.37
      Path: C:\Users\tkubacka\AppData\Local\Programs\Quarto\bin\
      CodePage: 1252

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.8.10 (Conda)
      Path: C:/APPS/Anaconda3/python.exe
      Jupyter: 4.10.0
      Kernels: python3, dashenv

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........OK
      Version: 4.1.2
      Path: C:/Users/tkubacka/Documents/R/R-4.1.2
      LibPaths:
        - C:/Users/tkubacka/Documents/R/R-4.1.2/library
      rmarkdown: 2.11

[>] Checking Knitr engine render......OK

### `quarto tools check` Output

[>] Inspecting tools

Tool         Status            Installed     Latest
chromium     Not installed     ---           869685
tinytex      Not installed     ---           v2022.07

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [ ] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [ ] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [ ] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
cscheid
2022-07-29T23:18:31Z
paniterka
bug ojs-engine
Future
closed
In Python, ojs_define() fails when trying to pass pd.Series
https://github.com/quarto-dev/quarto-cli/issues/1589