Practicing Colab Basics

Jessa Gavilla
4 min readSep 17, 2020

--

I have used colaboratory before but I need some refresher course so I am going to practice and code today! :)

Starting with the basics:

  1. Open Colab (https://colab.research.google.com/) and create a new notebook

2. Renaming my document to YYMMDD NameInitials

3. Save a copy in your drive

4. Add text by clicking +text or add code by clicking +code

  1. Practicing Markdowns:

1A. Inserting Header — Use # then the header you want to use
Note: Increase the number of # to make the text smaller

Then press shift + enter
Creating a smaller header by using two ##
Using three # this time
Using 4 # to make a smaller text
Using 5 # now

1B. Bold text — Start your text with two asterisks (**) and end it with two asterisks (**)

1C. Italicizing text — Start your text with a single asterisk (*) and end it with one asterisk also (*) or an underscore( _ )

Using single asterisk
Using underscore

1D. Strikethrough — Use two tildes ( ~~) for strikethrough

1E. Indentation — Use ‘>” for indentation
More > will create further indentation

1F. Ordered List — Use 1. 2. 3. and so on

1G. Unordered List — Use asterisk and then put a space before typing the word

1H. Nested List

2. How to run codes

Add a code by clicking +Code

Try running a code by typing !pip install Google and then press shift + enter to run the code

The arrow indicates that the code is running
Code ran successfully when the arrow turns into a number

2.A How to delete a cell — Click on the trash can button

2.B How to download your notebook — Click file then download

I used markdown for this hehe
Click on file then download

2C. Adding a comment — Click on the highlighted button

2D. Sharing a link of your colab — Click share button on the upper-right corner of the screen
Link: https://colab.research.google.com/drive/1ExrJW78RymttDzRgnpE1yZhiLWv2cNMk?usp=sharing

Share it with people!

Let us start practicing with some data :)

Importing a library: Use import pandas as pd as an example

Uploading a file: Choose the file you would like to upload after typing the code below:
from google.colab import files
files.upload()

Loading the csv file using Pandas

Using Pandas for descriptive analytics of the dataframe: df.describe

Cleaning Data using dropna function: df = df.dropna()

Saving the new dataframe as another CSV file

Downloading CSV files: files.download(‘insert file name here’)

Without row numbers: Index=False
With row numbers

--

--

No responses yet