2 years ago

#70907

test-img

saura

python code using Reticulate in R notebook is very slow and hangs every time

I have been trying to use reticulate within the R notebook to run the python code. However after running few commands, the python codes are extremely slow and eventually the entire R notebook run crashes.

Should I be doing something different to make python code run smoothly using the reticulate package.

For example, below is the code I run and then the whole notebook hangs specially if I use a moderately heavy file of about 80 MB. I am using a 16GB laptop and memory shouldn't be an issue. Am i doing something wrong here.

---
title: "R Notebook"
output: html_notebook
---

```{r}
library(tidyverse)
library(reticulate)
```

```{python}
import pandas as pd
import numpy as np
```

```{python}
iris_data =  pd.read_csv("iris.csv")
```

```{python}
iris_data.head()
iris_data.columns
iris_data.values
```

r

reticulate

0 Answers

Your Answer

Accepted video resources