Python Dataframe Automatic Refresh

Hi all,

I've recently switched to RStudio as my preferred IDE. Most of my work in done with Python, and have a quick question in how RStudio handles data frames... In particular, I have two external monitors in my lab and like to have my entire data frame in a separate monitor as a pop-out window. However, it does not seem that RStudio automatically refreshes / updates a data frame after a change is made. It works as expected with R script, but not Python. Minimal working example as follows,

R script:

df <- data.frame(group_a =  c(11,11,11,222,222,222,33,33),
                 group_b =  c(444,444,55,55,55,55,11,11)
)

df[df == 11] <- 77

The data frame automatically updates with the change in my external monitor.

However, the following does not automatically update with my Python script:

import pandas as pd 

data = {
  "group_a": [11,11,11,222,222,222,33,33],
  "group_b": [444,444,55,55,55,55,11,11]
}

#load data into a DataFrame object:
df = pd.DataFrame(data)

df = df.replace([11], 77)

With Python script in RStudio, I have to manually click and reload df for it to update in my external monitor or a pop-out window. Is there a setting in RStudio (or maybe some sort of extension) that automatically refreshes / updates a data frame? Any thoughts or suggestions would be greatly appreciated!

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.