Data Analysis with ChatGPT and Jupyter Notebooks and CodeGPT, your AI helper for VSCode
Use the ChatGPT AI to generate code for your Jupyter Notebook or pretty much anything else.
If you haven’t heard of ChatGPT you must have been living under a rock for the last few months.
I’ve been playing around with it to generate simple Data Analysis code and the results are quite pleasing.
You can follow my experiments here:
Data Analysis with ChatGPT and Jupyter Notebooks
The conversational way of generating code with ChatGPT works well with the cell structure of Jupyter Notebooks
I get the AI to generate code for reading data, doing some simple data manipulation and drawing graphs in Matplotlib and Plotly. It seems to understand Matplotlib better than Plotly and it occasionally makes mistakes but as long as you understand the code that it has written (and you can ask it to explain if you don’t!) then it is readily fixed.
It works well with Jupyter Notebooks as it remembers what it has done before. So if you ask it to, say draw a graph from a dataframe that it used earlier, it knows what that dataframe is. This means you can develop code little by little and paste each new section into a new Jupyter cell.
This would work well using a functional approach in a normal Python program.
Then I discovered CodeGPT.
CodeGPT
There is also an extension to VSCode that interfaces with ChatGPT. It generates code from comments, gives explanations and generates documentation, among other things.
It is quite useful as it is incorporated into the IDE. You have to get an API key from OpenAI to use it but otherwise, it is straightforward to use.
My only bugbear is that it does not remember what it has done in the past, so you can’t do the incremental development that I did above.
You can check it out here.
I have no doubt that AI can be a very useful tool for developers but, because it is not foolproof, the programmer must be in a position to understand the code that is generated so they can fix it where necessary.
The demise of the human coder is not yet imminent!