Google Colab for Programming and Data Science Basics

Upload the provided zipped files to Google Drive, unzip them, and then use the "start" files in Google Colab to practice coding by typing along, referring to the "done" files as solutions as needed.

Unlock the essentials of programming and data science with practical lessons using Google Colab and Jupyter Notebooks. Discover foundational concepts and key libraries in Python by actively coding alongside structured examples and exercises.

Key Insights

  • Explore essential programming concepts including variables, conditional logic (if-else), modules, loops, and dictionaries through structured lessons.
  • Gain proficiency in data science fundamentals by working extensively with the core libraries NumPy, Pandas, and Matplotlib.
  • Learn to effectively use Google Colab, a powerful environment that utilizes Jupyter Notebooks (IPYNB files), allowing seamless integration of explanatory text and executable Python code.

Note: These materials offer prospective students a preview of how our classes are structured. Students enrolled in this course will receive access to the full set of materials, including video lectures, project-based assignments, and instructor feedback.

Okay, so I am at Google Drive. I have uploaded the files, which you can download and you'll need to unzip them before you upload them to Google Drive, right? When you get the files, they'll likely be zipped up. You'll need to unzip and then upload them to Google Drive.

Make sure into my drive. So here I am on the folder. And when you go inside, you'll see there is a done folder, a start and some other resources.

I'm going to open up done. And you will see that we have 10 lessons numbered one through 10 consecutively. Each lesson covers a very important fundamental concept in programming and data science.

So the first five lessons are pure programming variables, if else logic, modules, which are libraries, packages that you import, loops, dictionaries. So each one of these lesson names is for a very important core feature in all programming languages. The last six lessons, NumPy, Pandas, Matplotlib, these are more data science specific with those three just named packages being the most important ones in data science.

Kind of the big three of Data Sci are NumPy, Pandas, and Matplotlib. What all of it is and does and how it works is what we're going to learn in this course. So the done files, we go into one of them are like the name suggests done, right? They've already been typed in.

Python for Data Science Bootcamp: Live & Hands-on, In NYC or Online, Learn From Experts, Free Retake, Small Class Sizes,  1-on-1 Bonus Training. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

So our goal is to not, we're not going to work in the done files. We're going to recreate them via the start files. So the done files are just solution files, finish files.

Where we work is we back up a level, go to start, which is basically the same files, except with the code for the most part stripped out. If I double click and go into 01 start, you'll see all the descriptive text is still there. Well, I'm in the prog file, excuse me.

If you go into 01 start, you'll see there is no code typed in there. And what I have here is prog, and I will recreate that for you, is I don't want to type in my start file just because I need it for next time, but you could type directly in the start file. What I've been doing and what I'm going to do right now, and you can do as well, is right click and say make a copy of the file so I don't type in the original start file, and it will rename it, take out that copy of the prefix, change the suffix there to prog for progress, and that would be the file that you type in.

Now, if you double click one of these files and it does not open up in this environment here, which is called Google Collaboratory, Colab, then we have to do a little something in Google Drive. You probably will have to do this the first time. If you go over to the right side, if you're on one of the files, you go over, you hit the three little dots, and you choose open with.

If you do not see Google Collaboratory show up in the open with side menu, then you have to choose connect more apps. Go ahead and search for Colab, and you'll see that you'll need to install it. There'll be an install button.

You click on that, and it'll walk you through the process, may make you re-sign into Google account. So once you've got Colab installed, then you would know it's running by going back to open with and seeing Google Collaboratory, and you can open the file this way. But of course, you just double click on it.

That'd be the easier way. So once you've got Collaboratory installed, that'll become your default open editor. And Collaboratory, Google Colab is an environment that provides what is known as a Jupyter Notebook, which is not unique to Colab, but it is something special for Python.

It's got a file extension of IPYNB for integrated Python Notebook. And the way it works is you have two kinds of boxes you can type in code and text. So what you see here is a text box, or a cell as it's called, and it's rendered nicely with big, bold, and bullet-pointed.

And if you double click, you can see under the hood how it's doing the formatting, this kind of clean, elegant system called Markdown, where one pound sign represents an H1 or large, double asterisk wrappers, bold text. Three pound signs or hashtags would be a smaller header. And then if you want a bullet-pointed list, just a dash.

And you can come in here and bold more items. So let's say we wanted these five to be bold, and I invite you to go ahead and do this. But you can also just double click, and there is a B button, kind of like in Microsoft Word.

And if you'd like to italicize, you could put one hash or one asterisk around a word or words, or you could just select the text and hit the I button for italic. And then if you come down and kind of click away somewhere, it'll re-render the text. And now you see that you have the bold and italic that we just added via the double and single asterisks.

So that's a rundown on Markdown, as it's called. It's a really handy way. It's not a format unique to this environment.

It's kind of a universal language for adding formatting to raw text. Readme files with a.md extension. That md stands for Markdown.

It's meant that when you read the file, you know, open it up in a browser or a viewing window, it'll render nicely. So you can always add more text. Kind of the idea is you want to, this Jupyter Notebook, as it's called, with the ipynb extension, think of it as a presentation format.

It's not just a raw code file where you just type like a.py file for Python, where it's nothing but code and maybe comments. Here, it's a presentation format, the idea being you're going to have an audience, right? You might, well, I do, right? You're watching. But what if you're watching a presentation? Well, you're going to have a lot of raw data.

You need to explain what's going on, maybe throw in some images and certainly some charts and graphs, being that it is data science. So the way we're kind of going here is we're alternating between text and code. So here's some text.

Here's more text. And aha, here we have a code block, which is a little bit different, with numbered lines. Now, if you don't see the numbers here, don't type them.

Excuse me, go up to tools and settings and choose editor and scroll down and choose show line numbers. Also click on AI assistance when we're in here and do not have any AI powered completions. High generative AI feature or high, yeah, so uncheck these two and check that one.

The idea being we don't really want AI helping us right now, like filling in as we start to type, like auto filling the line, because you won't really learn to program of course if you don't type code. It's like you're not gonna learn to drive by sitting in the backseat, right, and letting the AI drive you around. We want to turn off AI assistance and also have the line numbering.

This green text with the pound sign in front of it is known as comments. These are just notes to self or turning off existing code and you can add these in regular, like all programming languages support comments, so any language you're typing and you can write little comments that are not executed as code, but just explain the code or turn off code that you don't want to delete, but you don't want running. And once you execute your code, you go ahead and hit this little play button there and then it would turn on.

It will just run your code, kind of like hitting play on a tape recorder, VCR, whatever, iPod. So here's what we're gonna do. We're going to say VCR.

We're gonna say first name. We're gonna declare what's called a variable and we're gonna write first name and then put your name right there. And we'll say last name and put your name right there as well, your last name.

So your first name and your last name. I'm not gonna really stop for you to type like I would in a live classroom. That's just at any time you need to.

Of course, hit the pause button and type. I need you to type along with me though, okay? If you just watch, it might seem you'll feel like you're getting it, but it won't be the same. You won't acquire the skill set the same way at all.

You have to type code to learn how to code.

Brian McClain

Brian is an experienced instructor, curriculum developer, and professional web developer, who in recent years has served as Director for a coding bootcamp in New York. Brian joined Noble Desktop in 2022 and is a lead instructor for HTML & CSS, JavaScript, and Python for Data Science. He also developed Noble's cutting-edge Python for AI course. Prior to that, he taught Python Data Science and Machine Learning as an Adjunct Professor of Computer Science at Westchester County College.

More articles by Brian McClain

How to Learn Python

Master Python with hands-on training. Python is a popular object-oriented programming language used for data science, machine learning, and web development. 

Yelp Facebook LinkedIn YouTube Twitter Instagram