
According to NVIDIA CEO Jensen Huang, AI empowers everyone to be a programmer. This statement was made during his recent speech at the Computex 2023 forum in Taipei. As someone familiar with Python and capable of handling various coding tasks of moderate complexity, I opted to undertake a relatively straightforward coding experiment with ChatGPT as an assistant in order to explore how AI-powered tools could potentially transform programming into something that is truly within everyone’s reach. Let’s explore the specifics of my experiment and how it unfolded.
Caveat: I use the words “programming” and “coding” interchangeably in this text. However, in the software development industry, there is a subtle difference between the two terms.
When coding, it’s nearly unavoidable to come across something beyond your skill set that requires seeking assistance. So, before we dive in, let me briefly share my usual approach when facing coding issues.
First, I turn to Google and describe the problem using relevant keywords. Typically, the search results lead me to relevant links to discussions on Stack Overflow or similar websites that address the issue. I open what seems to be the most relevant link and go through the comments, hoping to find a suitable solution. If that doesn’t work, I move on to the next link and repeat the process. While this method can provide quick solutions for common and simple problems, it can become time-consuming for more complex issues and be intimidating for novice programmers.
Now, let’s take a look at the data as well as the objective that I wanted to accomplish with this experiment.
- Data : data file containing the daily prices of a stock index over a range of dates that span several years.
- Objective : to generate a boxplot chart that visually displayed the dispersion of daily returns for each month across multiple years. The chart must show 12 individual box plots, one for each month of the year. For instance, the boxplot for January must be constructed from the daily returns for that month, aggregating data from all the years covered in the dataset.
In order to assist me with this coding task, I provided ChatGPT with a description of the data and its structure, along with the goals I wanted to accomplish.
ChatGPT immediately generated a well-structured output that included a step-by-step solution with relevant Python code, explanations of each code’s purpose, and the option to easily copy everything. It also provided me with two friendly and valuable reminders. The first one was to replace ‘stock_data’ (a made up DataFrame name it used for illustration) with the actual name of the DataFrame I’m working with. The second one drew my attention to the required libraries for the code to work and how to install them, if necessary.
Check out the code generated by ChatGPT demonstrating how to tackle the task!

It’s worth mentioning that this initial solution didn’t quite meet my objective. It took a few rounds of back-and-forth to fine-tune and achieve a satisfactory result.
As part of this process, I prompted ChatGPT to make a few adjustments to the code, specifically to retrieve the values for the Month and Year columns and fine-tune the seaborn boxplot parameters, allowing all the months to be displayed on the same chart. Here is the result (in Python) after these adjustments were made.

I took it a step further and asked ChatGPT how to retrieve the descriptive statistics for the values comprising each boxplot. Take a look at the output obtained in Python by using the three lines of code it suggested.

What’s nice, ChatGPT also offered an explanation of what each statistic represents, as shown below.
- count: The number of data points for each month.
- mean: The average (mean) value of the daily returns for each month.
- std: The standard deviation of the daily returns for each month, which measures the spread or dispersion of the data.
- min: The minimum value of the daily returns for each month.
- 25%: The 25th percentile (lower quartile) of the daily returns for each month.
- 50%: The 50th percentile (median) of the daily returns for each month.
- 75%: The 75th percentile (upper quartile) of the daily returns for each month.
- max: The maximum value of the daily returns for each month.
I proceeded to have ChatGPT analyze these statistics and identify which months were more likely to generate positive returns. It swiftly processed the request and provided its findings. Interestingly, it offered some insightful words of caution regarding the use of historical data for making investment decisions.
So, will AI empower anyone to be a programmer? While AI-powered chatbots may not currently generate code to construct fully functional websites, applications, and software, they are revolutionizing the coding experience in multiple ways. As evidenced by this simple experiment with ChatGPT, they greatly enhance the coding process through:
- Providing real-time feedback
- Assisting with code debugging
- Offering contextualized assistance for specific tasks
- Accelerating the learning curve for novice coders
- Utilizing natural language communication
However, it’s important to acknowledge that these tools are still in their infancies. Because they use generative technique, they may occasionally hallucinate and generate misleading code, especially for complex tasks. Consequently, iterations and back-and-forth interactions may be necessary to correct errors. Nevertheless, as these AI-powered chatbots continue to evolve and improve, they hold promise for more advanced capabilities in the future.
In the meantime, for complex coding tasks, it can be advantageous to turn to discussion forums like Stack Overflow. This platform, for example, provides access to an expert community and a vast knowledge base that is constantly updated. Nevertheless, it’s worth noting that discussion forums can sometimes be slow and difficult to navigate.
Until programming becomes accessible to everyone through the magic of artificial intelligence, combining the power of AI tools with the insights and expertise of the community in discussion forums can provide a well-balanced approach to tackling coding challenges.

Leave a comment