SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

Trying to create graphs from tedious CSVs using ChatGPT Code Interpreter

If you don't know what ChatGPT's Code Interpreter is, please read about it here.


Original data and the finished graph

I used this CSV file.
It is the 'Survey on Municipal Tax Taxation Status, etc.'
Most Japanese open data is not even provided via API, and there are many PDFs and Zips. Actually, it's better that it's just in CSV or Excel format.

It displays a line graph showing the annual trends for the top five prefectures in terms of growth rate. Considering that the original data is municipal tax taxation data for each municipality, it is truly amazing to be able to draw a graph using only natural language, skipping requirement definitions and design...

Annual Growth Rate for the Top 5 Prefectures
Okinawa, Chiba, Saitama, Ibaraki, Yamanashi
Annual growth rate of the top 5 prefectures
Okinawa Prefecture, Chiba Prefecture, Saitama Prefecture, Ibaraki Prefecture, Yamanashi Prefecture

Specific ways to ask

You can draw a graph even if you ask very roughly.
However, it's a bit tedious because you have to wait or ask again each time.
That said, it's definitely faster than instructing a person to make it.

Watching the interaction makes me have flashbacks to when I was developing...
Thank you, ChatGPT.

https://chat.openai.com/share/6eb96d51-c260-481e-b75f-1e72f863027b

Prompts that can generate it in one go

The specific interaction is as follows.

Updated 2023/07/28

Although you can output it in one go with the method above, I will share a method with higher accuracy.

It is graphed properly in one go, and the reproducibility is also high.
Since the graph might be lost in the ChatGPT share, I will leave it here.

By the way, it can also process completely different files with the same prompt.

I will leave this graph here as well.

Garbled text is also okay

One more pattern

The line graph that was output...
Redraw as a bar graph

いいなと思ったら応援しよう!