How To Use Advanced Data Analysis For Non-Coders

Igor shows how to use ChatGPT's code interpreter to analyze data without writing code yourself. Upload CSVs or images, ask for charts and calculations, and iterate until you get what you need. The model runs Python in a sandbox, handles encoding errors, and can process multiple file types together.
Chapters
It can't be overstated how big of a deal the code interpreter is for the AI space. We're moving from information retrieval to action. And that's why we also need a new way of thinking how to prompt and how to interact with ChatGPT when using the code interpreter. And that's why I collected all of the findings I had while researching and playing around with this thing non stop for the first few days. And this lecture is filled with little tips and resources. So I hope you find this valuable and if you do, make sure to check out the course, because currently we hold live events like this every two weeks exclusively for course members. But this live event I really wanted to share with the world. That's why we edited it down and that's what you'll be looking at in today's video. All right, let's get into it. All right, well, first things first, welcome everybody. We're going to have a little session on the code interpreter here. This is going to be more of a strategical overview of what's possible and some of the things I managed to do with it already. We're going to start with kind of a high level overview and then we're going to get into the more concrete things. I found some exceptional resources. I think that's going to be the most valuable part of today's live event, sharing some of these resources. I ran into just a little preview. One of them is all the Python packages that it includes. I'm going to go into that, what that means soon. Secondly, all of the file formats it takes. And thirdly, how to think about this, how is this different from plain old chatgpt? I actually had some great conversations around exactly that topic throughout the last two to three days. And the punchline, it's very different. Everything that you've Learned about, about ChatGPT so far will be useful when thinking about this kind of new chapter. But it's just different. It's different in the way that this thing can actually perform action for you. So that's where I would like to start. I would like to build upon that mental framework that I introduced in the course where I always, like maybe too often stated that ChatGPT is your assistant, know, your personal assistant that, you know, has all the info that has been provided to it and she or he is there to help, right here it changes because if you think about a new assistant, if you're running a company, then that assistant essentially can perform actions right? But like if you say, get me a coffee, she can go out There, she can go to Starbucks, she can, you know, pay, she can get that coffee and bring it back to you. Whereas with ChatGPT, it was more on the informational level. It was more of a Google competitor type of assistant, as in a coffee getting type of assistant was extremely wise, right? All the information you provide to it, it can retrieve, can answer your questions. It has most of the human knowledge that is accessible on the Internet and it is there with one sole purpose, to help you out. But this really changed now because if you told ChatGPT, no matter how well you prompted it, book me a flight, there's no way to do that, right? If you added a plugin or used the browsing extension, it could provide you with a link to go to a website where you could input your credit card details and book a flight, but it couldn't book the flight for you. In other words, it couldn't actually take action. It was in a little jail cell. And this code interpreter thing, I can't overstate how big of a step this is for the space, because they opened up the gate of the prison cell a little bit, right? Like it's not fully free and out there and everything. It doesn't have all the capabilities, but it's able to take action now. Okay, maybe, you know, like with all the AI dystopian talk, the prison cell analogy is not the best. But the point being that it can go get you that coffee now, it can do certain things now, it can't do all things. But this is the beta version up until now, just to be clear. Like, they teased this a few months ago and it was an alpha up until then, which means just the most, you know, bare bones build. And now they moved to the beta phase, which everybody can access. So we'll get into the practical parts here soon, but first I want to give you this framework, how to think about it, Then I want to talk about some of the resources and then we'll get to the practical part. So at first it was more of a Google competitor, right? More of a you have a question, it gets you answer, you want an opinion, it gets you that opinion. With some exceptions, right? If you had to write something, it could do it, it could take the action, but that was limited to kind of the text capabilities, right? It could only take action within that realm of generating text or rewriting text. So it could take some action, but it was just within the realm of like using the keyboard. It could give you information, it could assist you in researching, but it couldn't go get that coffee. It couldn't go take that video file and transform it for you. It couldn't go ahead and write that little program for you. It couldn't go ahead and look through that Excel sheet, 20,000 lines. And it was not just limited in the way that it couldn't take action. In the limitations chapter, we talked about how still one of the biggest limitations is the fact that it can't take unlimited context. You feed it a research paper that is 100 pages long, it's going to tell you, sorry, it's too long. Well, these things are changing quickly because with the code interpreter, you are able to upload files and these files can be significantly longer than what was possible up until now. So the files can be larger, but you're still limited by that context window. And this is really the ultimate visualization. I would like to recap that because it's going to be so important when working with the code interpreter. Whenever you're like working with ChatGPT, there is a certain window with GPT4 that's 8,000 tokens. With GPT 3.5, it's 4,000 tokens. And it's a moving window. The more messages you send, let's say you start typing and that's fine, and then you type more and it gives you an answer, and then you give another. And at a certain point you fill up that window and you start sending out new messages, gives you new replies or. Well, because it has this 8K context window, you moved it to the bottom because it's always like stuck to the bottom and you lose the things that happen on top. Same case here. So if you write programs that are too long, or if it goes ahead and like loops five times and tries to rebuild its code, you're like, yay, good. Keep trying, you know, chatgpt, keep redoing. But at a certain point, you're going to start losing what it did on top. You're going to start losing your instructions. So that is like probably the number one thing to be aware of when working with the code interpreter. How to get around that, how to work with that. We talked about it in the course. You can use the OpenAI tokenizer. Actually, I don't even have it bookmarked. I always just Google OpenAI tokenizer. First result there, you can paste the entire conversation and it will tell you how many tokens that is. If you cross like 8,000 tokens, it has amnesia. It forgets. So now that we know the biggest limitation, now that we talked about how to think about this right? It's not just information retrieval machine, it's not just a writing assistant. But all of a sudden it has the ability to use codes to actually take action for you. Now we can move to the next part. What action can it take? Take? Well, there's a bunch of possibilities, but I think it really can't be overstated how big of a step this is. Because what this officially started is this new era from like AI that just helps you out and that like has a lot of info and is useful to AI that actually goes out there and presses button on the keyboard and moves the mouse and goes out there and our little analogy goes and buys that Starbucks coffee and brings it back to you, goes and buys those plane tickets. So it's a real shift from just like, hey, give me some info. I can, you know, repackage it. I can give you like research, I can give you information. What we had with Google to like, you want to go on a trip? No problem. Hook up your credit card in the settings and let me do the work. This is the direction code interpreter is taking us into, right? Okay. So first of all, you just go to beta features here and you turn on the code interpreter. So main thing is you can upload files, right? And by uploading files, you will add it to the context. Uploading files is one of the most powerful way next to including links, but now they disabled Bing off including context. And as you know, context is one of the most important things here, right? Instructions are pretty straightforward. So short. You have a bunch of them from the notion template, you have a bunch of others from your experiences across the Internet. But it's really the context that makes and or breaks this. So what type of context can we provide it? I actually started like compiling a list and then I opened up Instagram to procrastinate and I ran into a post that had a better list than I had. So here it is. There you go. ChatGPT tricks on Instagram. This is everything that I tried and more. You can upload images, you can upload audio files, you can upload video files, you can upload documents, spreadsheets and presentations and all these various file formats and more. All of the things you can see in here, JPEG, GIFs. It doesn't just take these, it also creates them. So you could go in and you could upload a video and create images from it. You could upload. You know what I did in the YouTube video is I uploaded a JPEG and I said, zoom in on the jpeg. And now make it gradual and now overlay a matrix style, you know, animation with the letters falling down. And all of a sudden I had a midjourney image that was like slowly zooming in with like matrix letters falling down. Right. Pretty cool for like a web interface. So that's that. So that's the formats it can take. One that really surprised me personally was the video files. Right. You can legitimately upload video files into here now it's not unlimited, but you can totally do it. And the same with like spreadsheets, presentations. I think the big one, if I had to highlight one that is going to be really useful, it's the CSV file format. Just because it's so compact and you can cram a ton of data into it as opposed to some of these others that hold a lot of information that you don't need here. Right. If you're going to be uploading a video file, there's a lot of information that it doesn't need. It doesn't need the audio, it doesn't need a lot of the details in there. But for the spreadsheets and for raw data, CSV is your go to. Because for anybody who doesn't know what a CSV is is just the simplest data format. Essentially what it means is comma separated values. That means all these value are just like written next to each other if the code interpreter looks at it and the only thing that separates them is a comma. It's literally like a comma and a space new data comma and a space new data comma and a space new data. That means it's as minimal as possible. You're literally registering like the data and the comma. That's it, no audio, no fluff, right? That is why the CSVs are the number one thing you want to be working with because you're going to be able to include the biggest amounts of data when you get a CSV. Luckily most Internet based platforms allow you to export CSVs. I'll show you two examples today. One will be YouTube analytics and also the Google Search console for any type of SEO. But you will find that most platforms, whatever you might have, whatever CRM, whatever learning management system, it doesn't matter. Almost every app that has some sort of database has a button somewhere that says export as CSV. Okay, I'll just show you a quick demo here. For example here with the Google Search console you can just say export. Okay, I have the German one, it's export here and Right. But like you can just say export and then you can say CSV file, right? And if you do this, it's going to say, okay, where should I save it? And then you can just save it in here. Here is my first tip of the day. You know, there you go. There you have various CSVs of the, you know, different countries that access the site and the click through rates and all the data that you get from in here. And now you can start working with it, right? I might have to disappoint you, but I'm no professional data analyst. But I have the code interpreter. So with some basic prompting I can turn myself into a beginner data analyst, right? And I'm sure there's some other people on the Internet that will be able to go way more in depth. But I have Twitter, I have the code interpreter and I can share some of the tips that I picked up there. I'm going to show you some beginner friendly prompts that we can use here. But first we're going to finish talking about file formats because as I mentioned, you have all these options, right? But one is not on here and this is the most useful one. Check this out. You can actually upload zip files. So if you would want to upload like let's say 10 PDFs, well, what would you do? You go here, you click plus. I picked a little prints PDF that uploads and then that takes a second because it's not a small PDF. But I could work with this PDF. Now I can't upload multiple PDFs, right? What do I do? Well, you can do this. Let's say these are two PDFs, and I could just say new folder with two selections, which we maybe call multiple PDFs, and let's say you have multiple CSVs or multiple PDFs that you want to work with. What you can do here is you can say compress and now here it is, multiple PDFs. There you go. And now it will upload it and by zipping you're able to work with multiple files. This is like really one of the biggest hacks, such a time saver because otherwise you would need to open Adobe Acrobat, kind of merge the PDFs, right? Resave and everything. And with data sets it's even more complicated, right? You might have different columns and everything. All of a sudden you get to work with all of these in one go. So this would be my first tip of the day. You can use the compress feature that is native to both Mac and Windows to include multiple PDFs, so there is definitely a privacy concern. If you have like highly classified files, I would not recommend using this. They stated that they only get stored locally and they get deleted after they get used. But I would approach it the same way I approach everything I feed chatgpt. I think social media might be taking in a bit far, but you know, if there's no way on earth you would share that data on social should probably not be sharing it with ChatGPT. Right? If you read their terms of use, they take the right to kind of analyze the data for research purposes and everything. But essentially the same thing goes for this. So if you upload, you know, files to it, you're kind of saying like, okay, OpenAI, you can have a look at these, right? Just be aware of that. What else can we do? It can do math. That is not that big of a deal because as I showed on the YouTube already with Warframe Alpha, you have some very advanced math abilities. What else can it do? Well, obviously it can analyze data. That is kind of the big one. Like everybody that has heard something about the code interpreter so far might realize that this thing can actually take and analyze data. Now I have some prompts for data analysis, some very basic ones that we're going to go into soon. But essentially that's kind of the biggest capability here. That's, that's the biggest thing to advertise. Like you could upload your data and then you can talk to it, you can ask questions. Actually, as somebody who's not very sophisticated in data analysis, I would say this is probably the most user friendly interface I've ever encountered. I can just ask my very basic questions and it will give me advanced results. And with prompts like create 10 visualizations to represent this data, you kind of take a shotgun approach. And you don't even need to know what you're looking for. You're just like, just create 10, right? And it goes ahead and it gives you a bunch of options like, hey, I created the scatter plot and I created a bar chart and I created all other types of charts that I couldn't even name, but it just does it for you. And then you can be the editor. You go in and you're like, ah, this one is useful, this one seems really fancy and this one's going to impress my boss. So that's a wonderful thing. You don't need to be super professional with it. You can take a shotgun approach. Okay, so it can analyze data, right? It can create charts, it can edit files and transform files as we talked about. And it can do math, but also Wolfram could do that. But obviously now that this runs Python, it can do math. Okay? So the last thing we need to cover here before we move on to testing some prompts, which is going to be the third and final part of this little presentation is, what is it? What is this thing? Code interpreter. All right, some of you might know what a code interpreter is. Visual Studio Code is a code interpreter, right? This app here, that's a code interpreter, but that's not the full picture, right? This is a code interpreter right here where you get to put your code into it and then it will go ahead and run the code for you, right? So it's essentially an interface between human and machine. But this is the key part I want you guys to take away here. Machine. That is the keyword there, okay? The code interpreter is just the interface between us and the machine, but they actually put the machine in here. What I mean by that is they put a computer in here. Why is that so interesting? Or why is that so revolutionary? You have a computer inside of a $20 a month subscription that also has a language model that is capable of retrieving all of the human knowledge available on the Internet. And that's pretty damn powerful. There's a lot of limitations on that. For now, there's very little memory. You don't have infinite uploads. You can only run 25 messages in four hours. There's only a limited context window, right? So you couldn't just feed it like any research paper and be like, hey, what does this mean? You know, can you contrast this with my company data? How could I maybe make use of these insights? It can't do everything yet because it's very limited. But essentially they gave us a free computer. It's moralistic, it's not neutral, right? It has opinion. So they gave us a little computer. And there's three facts we need to realize about this computer. And I wrote this down because it's quite important. First of all, it's sandboxed. What that means is that you get this safe little environment that the computer operates in. It's firewalled and it's disconnected from the Internet. So whatever you run in there, it's not going to be able to kind of cause harm on the Internet because it's disconnected. And I think that's a big deal. And I wonder when we're going to get code interpreter that is hooked up to the Internet, because that's the big one, right? They even removed Bing because that by itself Caused a lot of damage on the Internet, by the way. Anybody who doesn't know, they removed it because on all the paid sites, like let's say the New York Times, you need like a paid subscription to read their articles, right? ChatGPT could just get around that, it just saw through it, you could just bypass it. So they had to deactivate it for legal reasons. So that's why it's offline now. But once you combine this little code interpreter thing, this little the GPT4 language model, with a mini computer that can actually run programs and correct itself and do actions, and once you hook that up to the Internet, well that's where you get auto GPT might have heard of that too. That is kind of a software that went viral a few months ago where they essentially did that. They hooked up GPT4 to the Internet, they let it like automatically just execute tasks. So that is the routes that we're kind of headed in. But again, okay, so it's sandboxed, it's firewall, so it's like all in like this very limited environment and it's walled off from the Internet and it has minimal disk space. But within those limitations, we can actually do some cool things. Now what are those cool things? This is it. This is every non coder's nightmare. But let me actually break this down into a consumable form so somebody who has never ever touched code can understand what's going on on the screen. Here in the code interpreter, it can run one language, it can run Python. Okay, Python is really good for data analysis, machine learning and many other things. But it's very beginner friendly. And the reason it's so beginner friendly is because the way you kind of like write it and read it is relatively similar to human language as opposed to other languages being just like a complete no chance, no chance at all. But here it's often like, you know, if you're importing a file, if you're bringing in a file, the thing you say inside of Python is import and then you know the package name. And if you're trying to like show a piece of text, you just say print and then it's a bracket and then you say the text you want to show in quotation marks and then bracket closes, right? So it's like that's it, you're like print. Hi Igor. And that's it. It's kind of like humanly readable, right? So it's quite beginner friendly. And the reason I point that out is not because you guys should learn Python, which I would still recommend, and I still do recommend, at least, like basics. Like, you know, if you spend a weekend kind of getting the basics, you're going to open up a whole new world in terms of AI. But that's not the point. The point is, because it's so simple, a lot of people built upon it and they built these things named packages. And I really need to explain this because this is going to open up the code interpreter for you. A package. It's like a gift box with a bunch of useful stuff in it. Right. So it's like a little gift that somebody gives you with a lot of tools inside of it. And you don't need to understand what's inside of the package. All you need to know is that the package exists and what the tools can achieve. Okay. Example, one example is so called ocr. What is ocr? Well, it's a technology that allows you to look at images and extract the text. Now you know it exists. Cool. So what about ocr? What about this technology that allows you to get text from images? There's a package for OCR inside of Python. How would I know that? I would know that because I poke around the Internet and I know a little bit of Python. But if you look at that Python package. Yep. You'll start to find Python OCR libraries. Okay. There's this one, there's this one, there's this one, there's a bunch of them. Okay. And what this image is, is a list of every single package that the code interpreter can use. So OCR would be one of them. Right. But as you can see, there's a bunch of other ones and some of them are intuitive, some of them less. But if you want to see what's possible, I could do a 12 hour stream and look at every single one of these packages and kind of look at how that could be useful. Or I could just provide you with this image. Some of them are quite intuitive. Pie PDF, that's probably going to be something related to PDF handling. Right. What about some other ones? Not all of them are intuitive, but essentially image IO, this is a way to interact with images. This is everything it can do. So, you know, the takeaway is it can do a whole lot more than just the coding language can. It can do everything inside of these packages. So I would just say let it surprise you. And all the stuff that you're going to find across the Internet and on Twitter is going to be based upon these. It's going to be somebody opening, you know, like Using one of these packages to do something cool and then you know, they're going to show it inside of this interface. Okay? So it can do that. And there's another resource. So as I said, this is going to be a resource heavy little presentation. But this is like all the types of data analysis it can run, right? So this is a little more concrete than the packages. You can get all of this from the code interpreter. But as I said, honestly, I'm not sure what the discourse analysis actually means. And I know what quantitative research is, I know what sentiment analysis is, but I'm not exactly sure what the prescriptive analytics are. So, you know, you don't need to know these. The point is these are all built and now you just need to know what you're looking for. That's my whole point. So now we're going to shift to the practical part. But everything I said there is like pointing towards one thing, okay? And that one thing is this version of ChatGPT is a whole lot more action oriented and therefore you need to be asking for results. But if you take away one thing from today, it's that this thing does actions for you and therefore the way you prompted is based on what results you're looking for. So what results are we looking for? Well, let's see. I'm not even sure, but that's the cool thing I don't need to be because it can work by itself a little more, right? So as opposed to using vanilla ChatGPT where the whole course was about how do I ask the right questions, how do I add examples, how do I add additional context so my results get better here. It's more what is the outcome I'm looking for? So let's start doing something. So I'm going to feed it my YouTube data. This is just a simplified data set from my YouTube channel. Again, I just opened up my analytics. There was a button at the top, right that said export CSV file and I deleted like two columns from here. But essentially I'm going to give it my YouTube video analytics data. What now? Not even sure what I want to do, right? So I'm just going to use this, this brain, that prompt, which I absolutely love, creates 10 visualizations. So all I know here, as I said, we're prompting on top of the results that we're looking for. So what are the results I'm looking for? Well, it would be nice to visualize my YouTube data to get a feeling for it, right? Instead of looking at a chart. It works way better than The Bing browsing worked when it was still available with Bing browsing, in my experience it kind of failed like 60 to 70% of the time. This feels more like a 50 50. So actually in my testing this worked right off the bat. Okay, let's, let's see what's going on here. And this is where I'm saying like knowing a little bit of Python is useful because then you're going to understand like what's going on here. It imported a package by the way. I just happen to know this Pandas is kind of a data manipulation package. And then it says, okay, table data CSV and then just, you know, read it. And here we have the error message. This is where coding basics help because I know that, okay, there's a file not found error, no file or directory. Table data CSV so I love that when I test these things they always work. Like for example, with the Automation Live event, I remember like everything was so well prepared. And then when I went and tested it out, Zapier went down, which was the first time it went down in like eight months. And it went down during the 60 minute window I had the presentation. Okay, let's see if the underscores changed something. Otherwise we're going to switch over to some Google search console results. Okay, so this is, I'm, I'm sorry, I don't have an explanation for this right now and I don't have like five minutes to kind of figure out what's happening there. We'll just go from scratch, we'll just download the Google search console data and we're going to work on that and we're going to visualize that because that's the whole point here. Right? Okay, so code interpreter. And then in here I'm just going to unzip it this. So we're just going to work with the country data, right? This is from the past few days, just website traffic. So as you can see, USA is leading here. Click through rates, all that and we'll create a little visualization of that. Upload the lender CSV Perfect. And then we'll run the same prompt. Okay, so now I should go ahead if everything works according to plan, which by the way, that was a first with like not recognizing the file. I'm not sure what's going on. And there you go. And this is a thing that I was tempted to tell you guys during kind of the beginning of the presentation, but it's better shown than anything else the way this thing works. It just goes at it. If it Makes a mistake, it tries again. It doesn't get tired. Now, there is a limitation. If it keeps working for two minutes and it doesn't get the result, it kind of stops itself. But as you can see, it starts out. And let's go through the step by step. This is actually going to be very informative, I think. So first of all, as you can see, it's lender, CSV and German name. And it says the E is a special character in the German Alphabet. The issue might be due to the encoding or handling of such characters. It can't handle it. So let me try to change the file name. So instead of saying, hey, Igor, I'm sorry, I can't work with this. It's like, all right, no problem. You know, what would Assistant do if you were paying him and he was like, required to analyze this data? Well, he would go ahead and he would rename that file. Right. So it just does it for you. So this is step number one. So as you can see, it reads it and then it, like, tries to find a way to handle it. I'm not going to go into all these details. Actually, it appears there's a problem with handling special characters. I'll try a different approach to bypass this issue. I'll list the files in the directory and find the one that matches your description. Let's proceed with this method. And then it does the work. The file lend CSV is indeed present in the directory. I'm sorry for the inconvenience caused earlier. Let's try reading the data again. So it found a workaround by itself. It didn't come back and it was like, hey, sorry, can't do it. Some sort of excuse? No, it just did it. So that's pretty cool. Thank you for patience. This data has been successfully loaded. The data set contains the following columns. Name of the country, the number of clicks, the number of impressions. The click through rates represented as a percentage, the position of the rank. As somebody who did not carefully analyze this data set before opening it up, I gotta say, this approach is actually preferable to opening it up and making sense of it yourself. Right. It gives you the details, like, what does it mean? Like, there you go. That's what it means. Now that we have the data, let's move to creating 10 visualizations for a comprehensive understanding of the data set. I'll create a variety of plots, including bar plots, pie charts, line plots, scatter plots, and box plots. Let's start with a bar plot of the number and clicks by country. So it just starts Making up different visualizations just because I told it creates the 10. And here it gets to work. Isn't that great? Isn't that incredible? Just does all this. Is it perfect every time? Probably not. But what about this number of clicks with the frequency? All right, all right, that's pretty interesting. Let's find a really useful one here. Click through rate by country. So Ivory Coast. All right, all right. So it just sorts it like the high click through rates are over here. Okay, Interesting, interesting. And then you have descriptions, of course, number of impressions versus number of clicks. Let's see, what is this one? So they're not perfect. Certainly not perfect. But I'm sure there's something useful. This one is actually quite useful. Now it overlaps a little bit. But guess what? We know how to prompt and now we could go ahead and we could try making one of these better and we'll do exactly that in a second. But you can see, you know, this one is actually really useful. You can see the USA has the biggest share of the website traffic here. Then you kind of have the rest of the world. Let's say this is the most useful one. Okay. And the first visualization is a bar plot showing the number of clicks by country. As we can see, the USA has the highest number of clicks, followed by India. Now let's create a pie chart showing the distribution of impressions across different countries. Okay, so that's pretty great. I would love to have this one, but just show me the data that is above 10%. Right? Maybe let's just do that. So guess what? We can still use all the skills we built in the course and all the prompting knowledge we have in here. So what are we going to do here? Right, let's think about this. Let's take a step back. Well, first of all, we want instructions, right? What is the instruction going to be? Well, take the pie chart and then limit it only to the values above 10%. What else would we want to do? For additional context, it might be nice to color them in different colors. Right? So it's not fully green. Maybe it could be like different colors instead of different shades of green. And actually more context than that we don't even need to give because the CSV file gives it all the context. Right? There's a ton of context. It has all the context. It needs, all this country data. So let's see if we can make this work. I just copied in this part. Adjust the second visualization. Or maybe I can just say the pie chart to only show countries with more than 10%. And then I always do this. I always go back and use the same words it used, because then you avoid all kinds of, you know, ambiguity. So how did you call these? The highest share of impressions? This is it. So I'll just copy this. And this is really. It's a great little trick with more than 10% share of impressions. This is pushing it, but let's see if it can do it. Label them with the colors of the American flag. I don't know, that's just super random. But hey, might as well see if it can do it. And what I'm trying to show here is that you can kind of tap into all of the knowledge that ChatGPT provides when working with this. Whereas in Excel, if you would, say, take this graph and now change the colors to the American flag, you know, Excel wouldn't know what the colors of the American flag are, whereas GPT4 obviously does. So I hope this works. There you go. It actually kind of worked. So now it butchered the data a little bit though, right? Because this is exactly what we asked for. Now, USA is at 46%, but if you recall this, they're only 20% of the entire graph. So what it did is it did exactly what we asked for. It took USA, India, and Slovakia, the only three parts here that are above 10%. So that worked. It used American flag colors to color it. So that worked. But what didn't work is it assumes that these three countries make up 100% of the pie. So how do we fix that? Well, that's actually a bit of a tricky question. Let me see. Just the pie chart to only show countries with more than 10% share of impressions. Show the rest of the countries as one large gray other. And there we go. Just with two prompts. I'm actually pretty confident it will manage this with two prompts. Right? First of all, take the CSV, create 10 visualizations. And I'm like, yep, this is the one I wanted. I really wanted a pie chart. I couldn't have even said that in the beginning. I mean, I guess, okay, maybe I could have figured out, I want a pie chart on basic data like this, but as soon as you start getting a little more advanced or you have some deeper data than, you know, like what countries the website traffic came from, you might start needing one of these. You might need a content analysis, or you might need a scatter plot or a cohort analysis, and you won't even be able to exactly put your finger on what you need. So just ask for multiple Just like inside of ChatGPT, all the old tricks apply, right? If you're writing a Twitter or like an Instagram caption, don't say write an Instagram caption at the building block of write five Instagram captions. Same thing here. You know, if you're creating graphs, create 10 graphs. That would be my beginner tip. There you go. It actually did more than that. Let's create a scatter plot showing the relationships between positions and a click through rate for each country. It just did more, but there you go. So now I could obviously say, you know, color it gray so it stands apart and then also pick various colors. But essentially this worked. And you can see that with a bit of additional prompting as other in gray, it would fix this. And all of a sudden we have a graph that we created with like zero work and also zero creativity, right? Because all I did is give me 10 visualizations and then I picked the one I liked. Whereas, you know, like, picking is so much easier than actually creating. So there you go. So that's a nice little trick. I have another one. I have another beginner friendly data analysis trick here. So I just want to see this succeed and then we'll move on to that example. Okay, so now it actually messed up. And yeah, like it's creating the scatter plot and everything. But before that it got it right. Show the rest of the countries as other and label them. The perfectionist in me wants to spend another 10 minutes perfecting this little prompt flow that I kind of just spontaneously came up with this little sequence. But I think for educational purposes and to keep this under an hour, we should move on to the next one. So this will be my last attempt. I just want to see the other category labeled gray. This is too vague, right? Label them with the colors of the American flag. Okay, so it actually did it blue. It's this part that is the problem. Use different colors for every section. Because what it did is it overwrote this right here. We told it label it gray again. Prompt engineering is just trying over and over again. Like you built an intuition over time, but there's no way to kind of get it right on the first try every time. So I made a mistake there. I said, you know, make that section gray. And then I went and kind of overwrote my initial instructions. I was like, make that gray and then use.










