python – Jupyter: Generation of a dataframe code creation from Visual Studio Code data viewer?

I am using Jupyter notebooks in Visual Studio Code.

After a number of steps analyzing a large dataset, I created a short summary dataframe listing unique data. In VS Code I can view the data in the data viewer. I can export it to CSV.

I was wondering if there is also a way to generate the Python code that would be required to statically create this dataframe and data? Or is there a native way in Pandas or Python to do that?

(why? because not all datasets I analyze will contain everything so I would like to pre-create a lookup table and this would be a shortcut).

Thanks.

Worst case I can export to CSV and use the file to create my small reference dataframe.

Read more here: Source link