Chase Lean Profile picture
Jul 12, 2023 15 tweets 5 min read Read on X
How I use ChatGPT Code Interpreter to create incredible data visualizations

I just made this awesome animation of world temperature change from 1950-2000.

Red countries = 20% hotter vs 1950
Blue countries = 20% cooler vs 1950

How did I do it?

Steps below👇
Step #1

I first obtained 2 data files:

1. Global temperature data from Kaggle (.csv)
2. The outline of countries from Datahub (.geojson)

Then, I uploaded them to the ChatGPT Code Interpreter model.
Step #2

I waited for GPT to load and process the data.

There were some inconsistent country names between the two files.

So it automatically helped me to do some data cleaning.
Step #3

After that, I asked it to plot a map of these countries.

I asked it to color the countries based on their % temperature difference compared to the year 1900.

I also specified some extra stuff, like what color to use for the background.
Step #4

After a few seconds, here are the results.

But I noticed something weird.

Why were Canada and Russia blue?

Due to global warming, they were supposed to be hotter in 2000 compared to 1900, so they should have been red.
Step #5

So I asked GPT to explain.

And it looks like it made a huge mistake.

The temperature in Canada in 1900 was -5°C, while the temperature was -4°C in 2000.

Which means the temperature had increased, not decreased!

So GPT was wrong.
Step #6

I asked GPT to correct itself.

Then, I asked it to make a new plot.
Step #7

Finally, I asked GPT to adjust the title, as well as the color of the plot.

This was the result.
Step #8

Next, I wanted to make an animation!

I asked it to:

1. Simplify the map (to speed up processing)
2. Animate the map at 2 years per frame
3. Handle missing data
4. Provide me with a link to download the video
Step #9

Here's the result.

The video worked, but there were 3 problems:

1. The data for the US had disappeared
2. The label for the year was in the wrong place
3. The color bar was missing

Dealing with this took me a while.
Step #10

I asked it to double check the US temperature data and move the label for the year.

Eventually, it managed to fix all the problems, except the color bar.

I just couldn't get it to appear properly in the plot.

Other than that, I'm quite happy with the result.
Step #11

I downloaded the video, and here is the result:
Here's what I've learnt from this experiment:

1. GPT is a powerful tool for visualizing data
2. It can write complex code quickly
3. It sometimes repeats its mistakes
4. It currently has limited memory and processing power
Some suggestions if you are running this:

1. When an error occurs, ask GPT to troubleshoot for you

2. To avoid running out of memory, ask it to optimize the code first

3. When something works, ask it for the code. Copy & paste this working code into a future version of GPT
Overall, GPT Code Interpreter is an extremely useful tool. But it still has its limitations at this moment.

Want to see more real GPT experiments?

1. Follow me @chaseleantj for more high quality AI content.

2. Like and retweet the first tweet below to share it with others!… twitter.com/i/web/status/1…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Chase Lean

Chase Lean Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @chaseleantj

Jun 11, 2024
PixVerse just released a powerful new AI tool called Magic Brush!

It allows you to control how objects move in videos, and has some very interesting features.

Let me demonstrate with 7 examples + how to try it for free 🧵
1. Cars racing

Notice how you can make the car on the left move faster by drawing a longer arrow.
2. Colored balls

You can specify the objects to move in up to 6 different directions.

Each brush corresponds with one arrow.
Read 9 tweets
May 14, 2024
A few hours ago, OpenAI released their latest model, GPT-4o.

It's by far the best model we've seen so far, and it's available for free.

Here are 10 incredible things it can do:
1. It can accept text, audio, and images as input, and it is FAST.

The voice mode has a latency of ~300ms, 10x faster than GPT-4.

This means it can translate in real time:
2. You can get it to participate in a meeting.

It can listen to the conversation, and even speak for itself.
Read 12 tweets
May 10, 2024
Coloring book images generated with AI usually have 3 problems:

1. They are too detailed for young children
2. They have shading
3. It's unclear how to make a colored version as a reference

Here's a solution I found: Image
To solve problems 1 and 2, try the AAM XL model on @getremixai.

This model usually gives simpler images vs other generators.

For example, left: AAM, right: Midjourney.

It is also an anime model, which means that there is no shading.
 children's coloring book image of a girl riding a unicorn in space, beautifully colored, thick lines, simple drawing, plain, minimalistic
 children's coloring book image of a girl riding a unicorn in space, beautifully colored, thick lines, simple drawing, plain, minimalistic
To solve problem 3, we'll use a trick.

First, generate an image WITH color.

Here's a prompt you can use:

children's coloring book image of a [object], beautifully colored, thick lines, simple drawing, plain, minimalistic

Negative prompt:

shading, intricate details, bad, ugly, distortedImage
Read 5 tweets
May 4, 2024
ChatGPT can now be used inside Microsoft Excel or Google Sheets.

No more memorizing formulas or functions.

Here’s how to use it to reduce work hours: Image
Numerous AI lets you create ChatGPT prompts in Microsoft Excel and Google Sheets.

It's an AI add-on and you can check it out at .

Here's how it works: Numerous.ai
AI is changing the game when it comes to improving productivity.

Here’s how you can use ChatGPT in Excel and Google Sheets with @NumerousAI:
Read 7 tweets
Apr 9, 2024
I’ve shown you guys how to make flat vectors with AI.

But what if you already have a vector you like, but it doesn’t suit the theme of your website?

Here’s a trick to change a vector to any theme you want: Image
To demonstrate, I’ll be converting these two vector illustrations into a common theme.
Image
Image
First, upload the image to @rendernet_ai and turn on ControlNet.

This helps keep the subject and the pose consistent, while allowing you to change the style. Image
Read 7 tweets
Mar 16, 2024
Midjourney's new character reference feature is also great for making product photoshoots.

Now you can take different photos of the same product.

Here's a guide to get the best results:
Image
Image
First, a quick overview:

To use the character reference feature, add --cref at the end of your prompt, followed by the image link.
For this demo, let's generate a few different product photoshoots.

I'll be using this (real) image below as a reference product. Image
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(