0% found this document useful (0 votes)
15 views

A1 T1 Lecture1

Uploaded by

Qasim Hussain
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

A1 T1 Lecture1

Uploaded by

Qasim Hussain
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

A1 | Topic 1

Environments & Jupyter Notebook

Workshop 1
We acknowledge and pay our respects to the Kaurna people,
the traditional custodians whose ancestral lands we gather on.

We acknowledge the deep feelings of attachment and relationship of the


Kaurna people to country and we respect and value their past, present
and ongoing connection to the land and cultural beliefs.
Welcome to programming tools!
• Today's Focus:

• Python: A popular, high-level programming language.

• Anaconda: A free and open-source distribution of Python and R.

• Jupyter Notebook: A web application for creating and sharing documents with

live code, equations, and visualizations.


Environments Introduction
• What is an environment ?
A dedicated space to isolate and manage project dependencies (libraries and
tools)

• Why is it important?
Prevents conflicts between package versions and ensures smooth project
execution.
Anaconda Installation
• Anaconda is a free and open-source distribution of the Python and R
programming languages.
• It is used for scientific computing and data science.

• Steps to install Anaconda (check MyUni video):


• Download the Anaconda installer for your operating system from the Anaconda website.
• Run the installer.
• Follow the prompts in the Anaconda Install Wizard.
Your Turn - Anaconda Setup Check
1. Have you successfully installed and set up Anaconda on your computer?
Launching Jupyter Notebook
• Jupyter Notebook is an open-source web application that allows you to
create and share documents that contain live code, equations,
visualizations, and narrative text.

• Steps to launch Jupyter Notebook:


• Start the Anaconda application.
• Click on the 'launch' button under Jupyter Notebook.
Getting Started
• Jupyter Notebook will open in a new web browser window.
• Start creating your own notebook:
• Clicking on the 'New' button
• Select 'Python 3'.
Jupyter Notebook vs JupyterLab
• Two different interfaces for working with Jupyter notebooks
• Jupyter Notebook:
• Original interface
• Widely used by the data science community
• Provides a simple and interactive interface to create & edit Jupyter notebooks

• JupyterLab:
• A newer interface
• Provides a more integrated environment for working with Jupyter notebooks
• Includes features like a file browser, integrated terminal, and a text editor
IDEs and JupyterLab
• Integrated Development Environments (IDEs) offer a comprehensive
software development environment.
• JupyterLab is akin to an IDE.

• Key Features of JupyterLab:


• Tabbed interface for open notebooks and files.
• Basic file management.
• Debugging tools for code error detection.
• Enhanced rendering for data files.
Starting with JupyterLab
• If new to programming, start with Jupyter Notebook
• If familiar with IDEs or taking COMP SCI 7211, familiarize yourself with
JupyterLab.

• Launching JupyterLab:
• Open Anaconda.
• Click 'launch' under JupyterLab.
Notebook Interchangeability
• JupyterLab and Jupyter Notebook are fully interchangeable
• Both tools use the same .ipynb file format
• Work saved in one tool can be opened in the other
Your Turn - Launching Jupyter Notebook or JupyterLab

1. From Anaconda, launch either Jupyter Notebook or JupyterLab.

2. Were you able to successfully launch Jupyter Notebook or JupyterLab from


Anaconda?

3. Can you create a new Python notebook?


Programming Language
• Python 3 is the primary language used in this course
• Python will be accessed via Jupyter Notebook or JupyterLab
• These tools are pre-installed on lab computers
• Accessed via Anaconda
Creating First Python Program
• Create a new Python 3 notebook (Click 'New' -> 'Python 3')
• The new notebook will be created as 'Untitled'
• Rename it to 'My_First_Program_in_Python'
Types of Cells in Jupyter Notebook
• Code: Insert and run IPython code
• Markdown: Insert formatted text using Markdown, a superset of HTML
• Raw NBConvert: Convert Jupyter .ipynb notebook document file into other
formats (HTML, LaTeX, PDF, etc.)
• Heading: Insert header/title (not used in Jupyter Notebook, use '#' in Markdown)
Using Markdown Cells
Using Markdown Cells
• Change the cell from Code to Markdown
• Insert a heading using '#'
• Type the following text:

• Click on the button Run to execute your cell


• Double-click the cell to edit and then run again
Your Turn - Jupyter Notebook Shortcuts
Now, let's practice using some Jupyter Notebook keyboard shortcuts to run cells:
1. Ctrl + Enter: Run the currently selected cell.
2. Shift + Enter: Run the current cell and then move to the next cell below.
3. Alt + Enter: Run the current cell and then insert a new cell below.
Headings in Markdown
• Use hash (#) symbols for creating headings
• The number of hash symbols indicates the level of the heading
Lists in Markdown
• Use numbers followed by a period for numbered lists
• Use asterisks for bullet points
Emphasis in Markdown
• Use single asterisks for italics
• Use double asterisks for bold
• Use three asterisks for bold and italics
Line in Markdown
• Use three asterisks for horizontal lines
Math Symbols in Markdown
• Use dollar signs to enclose the mathematical expressions
Using Code Cells
Writing First Python Code
• Create a new code cell

• Type and run the following code:


Getting Help
• Use 'help' command to get information on Python functions

• This will display details of the 'print' function


Using Variables in Python
• Type and run the following code in a new cell:
CRICOS 00123M

You might also like