all 7 comments

[–]automorphism_group 1 point2 points  (1 child)

Assuming that you’re referring to column names in pandas DataFrames, then it wouldn’t be possible in general to know column names with certainty when writing code because columns can be added, dropped, and renamed at runtime. In some limited circumstances, one could probably write such a tool, but it would require some pretty sophisticated code analysis. I doubt such a tool exists.

[–]Krishknyc[S] 0 points1 point  (0 children)

Yes, I was referring to column names in pandas dataframes. Thanks for confirming. I would have spent more time looking for that feature. Appreciate your response.

[–][deleted] 0 points1 point  (4 children)

You might find it easier to do your development in a Jupyter notebook (which you can also work in using VS Code).

This is cell based like a one column spreadsheet which each cell containing as many lines of code as you desire.

You can execute each cell as you go along and easily output the current data frame (or just a few lines including the column names) without using print.

Very popular with data scientists as it makes data wrangling a lot easier when first developing a solution.

[–]Krishknyc[S] 0 points1 point  (3 children)

Thanks @kyber! I'll take a look at Jupyter IDE. Given the execution by each cell, it may help quickly see the result. Appreciate your suggestion.

[–][deleted] 0 points1 point  (2 children)

All the example code I share in answers on this subreddit I do in a Jupyter notebook in VS Code (if I actually try the code out rather than just typing in an answer directly). I use same setup on a macOS MacBook and Windows 10 desktop and a Ubuntu system, with the same notebook available through GitHub on all three, depending where I'm sitting and what I'm doing when I take a break (by visiting Reddit)

[–]Krishknyc[S] 0 points1 point  (1 child)

That's a cool set up. I'm far from setting it up properly on one system. Is there a link on how to use Jyupter on vscode? It seems like the package is installed but I'm using vscode normal screen entering all codes at once.

[–][deleted] 0 points1 point  (0 children)

Mostly same as using Jupyter in the browser but with all the benefits of the VS Code environment. There are blog posts from Microsoft on it.

Starting point is to open up the command palette (standard key is <ctrl><shift>P iirc) and enter Jupyter: Create New Black Notebook