-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DS: Provide rich debugger support for pandas DataFrames #1286
Comments
I share the same need. While hovering over a pandas DataFrame in debug, it would be nice to render the html view of the dataframe head, with horizontal/vertical scrolls. |
@apryor6. In the interactive window experience we have a data viewer for pandas dataframes. Is this the type of viewing experience that you would like with a standard VSCode debugging experience? https://devblogs.microsoft.com/python/python-in-visual-studio-code-april-2019-release/ |
just giving my 2 cents: vscode variables explorer viewer or IPython.display.display are both good options. whatever makes the user experience more consistent. |
@IanMatthewHuff yes precisely like this. The ideal user experience would be that when paused at a triggered breakpoint that an icon appears next to the variable name if it is a DataFrame that opens this viewer on click or that such a window appears on hover. |
I have the same need. Is there any workaround for this? What are you guys using when debugging a dataframe inside vscode? |
while debugging, I type in the Debug Console
|
Ok. Thanks Nuno! I see. I am not using jupyter environment. I am using python debug inside vscode. Even after importing IPython, I get None when using IPython.display.display(DataFrame). |
I think this is the only thing still keeping me on PyCharm :) |
@szc11121 the ideas that @DonJayamanne was playing with have not shipped. That feature is not supported yet. |
Chiming in to voice support for this feature. I like the suggestion from @szc11121, although just having the "Show Variable in Data Viewer" icon directly in the VARIABLES sidebar on the right of each variable it applies to (and double-click the line to open data viewer) might be cleaner. Alternatively, if there were a separate list of Data Science Variables, perhaps make it look and function the same as the Python Interactive Variables table. |
I would like to add my support for this feature. I am working a lot with pandas DataFrames and having tables and variable description helps a lot in the debugging process. This format is available in spyder which came from the MatLab way of thinking, and Pycharm included a data science working setup which gives this possibility as well. vs code should have the same setup this is a must! |
Hi, |
No longer works with python extension version 2020.1.57204 . See microsoft/ptvsd#2036 |
Still waiting for a DataFrame Viewer in debug mode :( |
I'm following this to learn when I can switch off PyCharm... |
Would be great if you supported a debug visualizer extension point like studio |
Same need here :) |
I really really need this feature! |
Having rich view is one great thing, but NOT having a raw string with newlines emebeded and everything is one basic thing. Could you at least show the standard dataframe representation which is ok as far as it goes? |
please add this. This would make my life so simple. The only thing that VS Code doesn't have, and PyCharm does have. Do this, and I'll be in remote debugging heaven. My boss will give me a raise, and I will cure cancer. |
This is a feature VSCode desperately needs |
I think extanding this feature to other data formats (e.g. numpy arrays) like in the already supported data viewer would be great. |
Looks very promising. |
Our company uses Visual Studio Professional as the primary IDE and to my disbelief viewing dataframes isn't a feature in VSCode or VS Professional! Python in general seems like an afterthought in VS 2019, it's clunky and slow with bugging autocomplete. The print(df) method in the VSCode Debug Console does not allow you to scroll to columns that are out of the print view. PyCharm is a much smoother development experience at the moment. |
Looks like everyone just keeps bitching about this without providing any solution to move forward, @bw984—and annoying everyone subscribed to this in the process. For instance, if your company uses VS as your primary IDE and you're in disbelief, why don't you invest in creating a plugin? |
For the $800 per year VS Professional cost I would hope that itellisense wouldn't be broken, but it is horribly broken for python. I would expect the debugger to be able to ignore certain custom raise exceptions, but it can't. I would expect to be able to view the data in a dataframe while debugging, but I can't. These aren't major asks for a "professional" IDE. Python support feels like a complete afterthought in VS Pro. Until the python experience at least matches the that of the free VS Code I think additional investment is best spent on companies who are working to give python developers a first class experience. At this point in time I'd rather pay for a yearly enterprise license of Pycharm out of my own pocket than be forced to use VS Pro for python development on the company's dime. |
I feel your pain, I'm just wondering why you'd post a comment here to complain to the devs without offering any kind of solution—can't you call support and ask for your money back? A few comments ago I suggested we get some money together on BountyHunt or whatever it's called, and pay somebody to do it since Microsoft seems to out of cash and developers What does your company think about that..? |
Where does this requirement fit on the VSCODE roadmap? |
What is really needed is the Pycharm science mode! |
You have to print the dataframe to see that output, it's not built into the debugger at this time. If you have many columns you won't be able to see all of them. |
I've been using Azure Functions, which is a nuisance to use outside of vscode. This feature would be very helpful to those of us locked into vscode for this reason (although that's not to say I don't really like vscode!). I've been using the |
It's not as convenient as hovering over a DataFrame, but you can install https://github.com/adamerose/pandasgui and start it from the debug console. To visualize a
|
That's worth knowing about so thanks for mentioning it. Though if you're going to use an external process to visualise, it feels like that process should be Excel (or your favourite vegan alternative), e.g.: def show(df):
df.to_excel('tmp.xlsx')
subprocess.call(['excel.exe, 'tmp.xlsx']) |
I spent some time researching this topic to see how hard it would be to create such a visualizer extension for the Python debugger in VS Code. I found no easy way. Debug Visualizer, but the support for Python (not to mention DataFrames) is very limited. I created a feature request microsoft/vscode#111105 for VS Code to support custom data visualizers. It will be added to the roadmap when it gathers 20 upvotes. 🗳️ Go to microsoft/vscode#111105 and vote by clicking 👍! |
I built myself a solution for numpy arrays in Jupyter notebooks. It works in VS code but also in other Jupyter environments. Probably doesn't entirely replace the feature asked for in this thread, but it's a good enough intermediary solution - for me at least. 😄 |
We have added the ability to open DataFrames in our data viewer from the debugger. Here's a GIF of this in action from our blog post: Our data viewer currently supports an allowlist of data types, with more enhancements on the way. We appreciate your patience and look forward to your feedback! |
That's quite a good start! |
Thanks for your ideas @agrimaldi74, I've created new issues to track them. We'll be closing this issue now that we have added DataFrame support to the debugger. Please open a new issue if you encounter problems or have suggestions for improving the current experience 😊 |
I build lots of Flask APIs that internally use pandas DataFrames, and almost daily I find myself jumping into the debugger; however, there is not a particularly good way to inspect the contents of DataFrame. Ideally there would be a way to, perhaps, double-click or hover on a DataFrame variable and have a popup that shows the first few rows spreadsheet-style
The Spyder IDE has something like what I describe
Currently, I find I am limited to either:
I've felt for some time that this would be a great feature, but honestly I assumed there would be a large number of other data scientists sharing the same request and that it would magically appear. This is me conceding that point and doing what I should have already and making the request.
Edit: I see a teaser for such functionality from some time ago here, but I don't see this inside of the app. Am I missing something, or is there an update?
The text was updated successfully, but these errors were encountered: