How to use chatGPT's code interpreter, pretty easy

OpenAI’s code interpreter is actually easy to use. It’s basically the usual chatgpt plus capability to upload data and run the code.

For how to turn in on in the chatGPT UI, following the following link:
turn on code interpreter in the UI

Without code-interpreter, when we want to ask chatGPT to generate somde code, we will first desribe our needs, and the code wil be generated. But we then have to copy the code to our actuall notebook or other IDE environment, and run the code with some data. If there were issues, we may come back to report the error and chatGPT will make further adjustments.

But with code-interpreter, the code can be actually interpreted and run immediately. So user have chance to see the results and discuss feedbacks with chatGPT right away.

Here is some simple example data that I have:


stored locally in my computer as a file called “testdata.txt”.

Now I begin to use chatGPT, as usual, I give instructions to chatGPT and want to group the data by ages as the following, and chatGPT gives code results as the following:

Now is the difference between code-interpreter and other modes, where we can click the “+” button on the message box and upload the file:

After the file is uploaded, chatGPT understand the context better, updated the file name, and I continue to say “correct” or “continue”:

Finally, chatGPT will continue to run the code with the actual data and give me the results:

Author: robot learner
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source robot learner !