Chapter 2: Getting started with Jupyter and Colab#
Let’s Take a trip to … Jupyter#
Data Science is a process that involves a fair amount of coding. To be able to go back and forth between lines of codes and run them independantly, include equations, images, data scientists have came up with the concept of NOTEBOOKS.
The most popular notebook technologies today are Jupyter (supporting over 40 languages including R and Python. Simply put, imagine notebooks as an environment where you can write, edit your lines of codes, include images, videos to allow an easy readability for any potential reader aside you.
What is Jupyter Notebook?#
Jupyter is a tool that allows data scientists to record their complete analysis process, much in the same way other scientists use a lab notebook to record tests, progress, results, and conclusions.
Originally developed as part of the IPython project, the Jupyter product was used to provide interactive online access to Python.
Over time it became useful to interact with other data analysis tools, such as R, in the same manner. With this split from Python, the tool grew into its current manifestation of Jupyter. IPython is still an active tool that’s available for use. The name Jupyter itself is derived from the combination of Julia, Python, and R.
Multiple usages#
It is an open source web application that gives you the power to create and share documents that contain live codes, equations, vizualisations and narrative text. As a few things that you could do with Jupyter, there are:
data cleaning, transformation, numerical simulation
Statistical modeling, data visualisation and Machine Learning
Running un Julia , Python and R scripts!
Making your code followable by your audience trough interactiveness
Saving your code in various formats (pdf, .tex, .ipynb, .html, … )
You could also use it with your latex syntax. For instance, see the Lorenz System below:
where we set \(\rho = 10 , \quad \sigma = 28 \quad \textrm{and} \quad \beta = 2.667\).
The
edit
mode lets you change the content of a cellThe
command
mode lets you modify a cell as a whole
Let’s explore it!!!!#
Creating, adding cells above or below
Enable the shortcuts dashboard
Changing the mode (Heading, Markdown, code, …)
Renaming, deleting, copying, cutting, pasting cells.
You can easily import graphs and also build your own graphs as wellas well.
#See my code here
cities = ['Kumasi' , 'Cairo' , 'Karthoum' , 'Surulere']
for city in cities:
print ('Welcome to ', city)
Welcome to Kumasi
Welcome to Cairo
Welcome to Karthoum
Welcome to Surulere
#try and change the cities and print the same
Task : #
try and change the cities and print the same
Ready to Colab?#
Google Colab is a Jupyter Notebook stored in Google Drive.
It is a free cloud service and now it supports free GPU! You can:
Improve your Python programming language coding skills.
Develop deep learning applications using popular libraries such as Keras, TensorFlow, PyTorch.
Let’s try it!!!#
Task: #
Set your Google Colab account (Simply click on this link)
Click on
New Notebook
and Bingo!!! your Google Colab account is activated.From your Gmail, navigate to your Google Driver folder. Could you see a folder with a yellow icon?
Create a Github Account via this link. It is useful if you want to share your codes with the whole world.