Lecture: Learning Python 1-Google Colaboratory ver. 8

Last Updated on July 9, 2022 by shibatau

The link to Python 6-If Statements is added.

I. What will you learn?

These posts are Python tutorials for beginners and used for my lectures.

Learning Python 0-Cheat Sheets

Learning Python 1-Google Colaboratory

Learning Python 2-Sample data

Learning Python 3-Lists and Comprehensions

Learning Python 4-Dictionaries and Data frames

Learning Python 5-Functions

Learning Python 6-If Statements

Learning Python 7-For Loops

Learning Python 8-Classes and Objects

II. Create a notebook in Google Colaboratory

You are recommended to use Google Colaboratory to learn Python because you can run Python codes online without installing anything on your computer. You don’t have to create a virtual environment and they don’t cause any harm to your computer, even if you have got any troubles on Google Colaboratory.

You have to create a Google Account beforehand. Then, click on the following link and create a NEW NOTEBOOK.


Use Shift+Enter to run codes in a cell. You can also click on a button 3  below instead.

III. Getting a sample data

Let me show you some scripts on my sample datasets. First, load all the tables on the page as lists using Pandas and then show the first one with lists[0] as shown below.

You can see the scripts and other sample scripts here:


You can learn more about how to handle the sample data in Learning Python 2-Sample data

IV. How to use Runtime

Run all: run all codes.

Restart runtime: sometimes you are requested to restart runtime after you have installed a library.

Disconnect and delete runtime: delete runtime when you want to run scripts from the very beginning.

V. Upload the data

You can upload a CSV data and read it with Pandas like this:

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.