Converting Lists of Data to CSV — Using a Colab Notebook Hosted in Gists

I’ve really been enjoying learning about data analysis lately. Part of what’s made it so enjoyable is the use of Colab, which is Google’s version of Jupyter Notebook.

I came across a need to convert some lists of data to a CSV (comma separated values) format so I could paste it into a Google Sheet. Not finding anything online to do I decided to write my own, and here is the product.

The Colab notebook I created has been saved as a “gist”, which is GitHub’s cousin for fast and easy file storage service. The Gist website is also very popular for sharing CSV files, which this search will attest to.

You’ll notice an “Open in Colab” button at the top, which is how you will open the document. A really nice feature is that it is fully usable without needing to save the file anywhere, but for those that do want to save their work, they can, into Google Drive.

When you first run it, you’ll get a scary message that was written by Google’s lawyers. You’ll see from the source code that the notebook’s not doing anything nefarious, so just trust me and click on “Run Anyway”. 😆

Google Colab Warning

This is a preview of the notebook. To open it, click here or on the filename on the bottom left corner of the preview.

Some Python programmers may want to remind me that I could have used Python’s built-in CSV library, but I felt Pandas would be faster, especially for large lists.

I hope some of you find this useful, although I’ll be happy if it gets some of you interested in Colab for Python programming or for data analysis, or even if it just introduces you to the Gist website.

Integrating Google Drive into Google Colab Notebooks

Why might we want to integrate Google Drive into Google Colab? The primary reason for this would be to easily access data files to use in your Colab notebooks. 

Here is a video that outlines the basic process. For written instructions, see below.

Integrating Google Drive into Google Colab is quite simple. The first step is to go to Google Colab, then open a new notebook.

Continue reading “Integrating Google Drive into Google Colab Notebooks”

#100DaysOfCode – Come Join the Fun!

Have you wanted to learn how to program but lacked the support? #100DaysOfCode is a formal (but flexible) process with a clear set of rules designed to motivate you. Part of the process involves sharing your goals and progress via social media and your files via GitHub, which is a free online repository website and version control service which many teachers are now using as an alternative to a traditional website.

Come learn how to get started and how the process works. You’ll especially benefit from this session if you never used GitHub and want to learn how easy it can be. Continue reading “#100DaysOfCode – Come Join the Fun!”

Relational Databases – How to Choose

Relational Database Comparison screenshot

As a Python programmer and teacher, I’m always on the hunt for good tutorials. Some of the best Python tutorials I found are on a YouTube channel named Socratica. For these videos they have a McGill CS graduate & actress named Ulka Simone Mohanty [@ulkaM | resume] whose character is a quirky, robot-like narrator with a very dry sense of humour, which for me, makes the videos especially entertaining.

In my YouTube subscription alerts I saw that Socratica has just released some new videos related to SQL databases. If they’re as good as their Python series I had to check them out.

It was nice to see that they are also using Ulka to narrate this series. And it’s nice to see that the videos are just as entertaining (and informative) as the Python series.

I have some experience programming in MySQL (thanks to Dr Chuck) so was really interested in its popularity vs PostgreSQL and MariaDB. The video is only an overview, but it’s enough to whet my appetite about revisiting my old My SQL programs and seeing how difficult they are to convert to the other formats. It also gets me thinking about investigating free accounts in the cloud for any databases I write.

I’d love to hear what you think about these videos. Do you find them as entertaining and informative as I do?

(Credit to the video for the screenshot used above)