How to Save and Download files from Google Colab

Welcome to the Data Professor YouTube Channel

If you're new here, my name is Shannon Nontox and Ahmad, and I'm an associate professor of bioinformatics on this YouTube channel. We cover about data science concepts and practical tutorials. So, if you're into this type of content, please consider subscribing.

Making the Most Use of Google Colab for Data Science Projects

So, in this particular video, I'll be showing you how to download files that you have generated in your Google Code Lab. This is yet another tips and tricks video, and it's going to help you make the most use of Google Colab for your data science projects.

Getting Started with Google Colab

The first thing that you want to do is open up your Google Colab and click on the GitHub tab. Type in "data professor" and click on the pandas dataframe tutorial. Now, let's run all of the cells. We want to export the generated data frame, and the data frame is in results. You can see that the results data frame contains two columns actual and predicted.

Exporting and Downloading Data from Google Colab

Here we're going to export it out results dot underscore CSV and then the name of the file results dot CSV and then index equals to false because we don't want the index column. Let's do the LS, and you see the CSV here. Let's do a cat's in the bash cat results done CSV okay, and here you see the generated CSV file.

Now that we have our CSV file, let's download it into your computer by clicking on the folder icon on the left. Then, it will expand the files in your current working directory. You'll be shown here. To download the file into your computer, right-click on the file and then click on download. In just a moment, it will download it. Okay, and it has already downloaded, and it automatically opens up my Microsoft Excel.

Understanding How to Download Multiple Files

So, you could do this for other files in your current working directory. Let's say that there are several files that you want to download. You can even sip up the files. So, let me show you. I'm gonna generate a couple of CSV files, essentially I'm cloning the files here okay now s - L shift-enter.

Here we will be seeing that we have the files results one two three four and results dot CSV. There is a total of five CSV files. Let's zip it up exclamation mark sip and in the name of the file that we want to generate results not zip and then star dot CSV shift enter okay, and there you go. You have the results.

The Benefits of Downloading Multiple Files

So, all of these CSV files are downloaded alright. This will come in handy when you have several files in your working directory and you don't want to right-click on each and every file. So, you can sip it up and download the zip file. The second benefit of that is that when you sip the file, the file that you will download will be much smaller.

Conclusion

So, I hope that this tips and tricks video will help you in your data science journey. In order to learn data science, the best way is to build your data science portfolio by doing data science. So, enjoy watching please like subscribe and share and I'll see you in the next one but in the meantime, please check out these videos.