0% found this document useful (0 votes)
0 views8 pages

Unit+1+ +Python+for+DS

The document serves as supplementary learning material for a Python for Data Science course, covering the basics of Python programming, its features, and installation of Anaconda Navigator. It highlights Python's ease of use, versatility, and its applications in various fields, including web development and data science. Additionally, it provides instructions on launching Jupyter Notebook and using its features, including different cell types and keyboard shortcuts.

Uploaded by

saad.sheriff20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views8 pages

Unit+1+ +Python+for+DS

The document serves as supplementary learning material for a Python for Data Science course, covering the basics of Python programming, its features, and installation of Anaconda Navigator. It highlights Python's ease of use, versatility, and its applications in various fields, including web development and data science. Additionally, it provides instructions on launching Jupyter Notebook and using its features, including different cell types and keyboard shortcuts.

Uploaded by

saad.sheriff20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Supplementary Learning Material

saadsheriff1895@gmail.com
J732KOTCSB

Program: MCA
Specialization: Data Science
Semester: 2
Course Name: Python for Data Science
Course Code: 21VMT5S204
Unit Name: Introduction to Python

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by saadsheriff1895@gmail.com only.


Sharing or publishing the contents in part or full is liable for legal action.
Unit 1
INTRODUCTION TO PYTHON
Overview:
Python is used for general purpose programming. It is easy to use and understand. It can be
used on a variety of operating systems. It forms a gateway into the realm of programming. A
lot of start-ups and small businesses use python since it is free of cost and any product is
easy to build with lesser codes. Time management is better with python. The scope of
python is ever increasing, and it becomes important to know the subject when one chooses
to delve into web development or data science.

Learning outcomes:
 Knowing about python
 Features of python
 Installing Anaconda Navigator
 Launching Jupyter notebook
 Basics about Jupyter notebook

saadsheriff1895@gmail.com
J732KOTCSB
What happens to be amongst the most in-demand programming languages was in-fact
started as a hobby by its creator Guido Van Rossum to keep him occupied during Christmas.
Today, almost all big companies use python for their services in some way or the other.
Amongst the renowned ones are Google, Pinterest, Netflix, Quora, etc.
First things first, what is Python?
Python is a programming language, just like C, C++ and Java. It is a scripting language. It is a
Object-oriented- this means that its paradigm is based on ‘objects’ and ‘classes’. Python is
dynamically typed, meaning, the interpreter gives the variable a type during runtime based
on its value and it does type checking during the same.

Features of Python:
Python has various features, major ones of which are:

 Easy to understand: The python code is easy to understand because the syntax is
uncomplicated and in English. Python does not use braces for different functions, it
uses indentation which makes the code look clean and neat, thus making it readable.
 High-level language: a high level programming language is that which is user-friendly
and resembles natural human language.
 It is an interpreted language: The python code is executed one line at a time unlike
C++ which is executed all at once. The interpreter displays the output one line at

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by saadsheriff1895@gmail.com only.


Sharing or publishing the contents in part or full is liable for legal action.
once, which means that if there is any error, unless the error is resolved, the code
will not be executed any further.
 Object-oriented program: as mentioned before, an OOP means that python treats it
as an object.
 Open-source: Python is an open source programming language. It’s codes are freely
available for usage. It is an interpreted language that can be used by anybody for any
purpose.
 Platform-independent: Python can be run on platform such as Windows, Linux, Mac.
The code for a program on each of these platforms will be the same.
 Extensible and embeddable: One can run codes from other languages on Python,
which makes it an extensible programming language and the other way around- they
can also run python codes on C++, Java or any other programming language. Hence,
it is also embeddable.
 Large Standard Library: Python has a collection of modules that make it easy for
people to code in it. Modules are sets of code that are pre-written so that one
doesn’t have to re-write commonly used commands every time. Modules can be
used by importing them.
A python file is saved with a .py extension. It is easy, fast and efficient. It has a wide range of
applications some of which are web development, scripting, data science, prototyping and
programming a database. All of python’s features like simplicity, easy of use, flexibility,
portability, development speed and programmer friendliness puts its use above other
saadsheriff1895@gmail.com
J732KOTCSBprogramming languages’.

Python IDEs
 What is an IDE?
Integrated Development Environment, in easy words, allows programmers to combine
various parts of a program in a single GUI based application. An IDE ideally constitutes of a
source code editor, build automation tools and debugger. There are some IDEs that are
multi-language, like Eclipse and Visual Studio. IDEs are easy to setup, they make
development faster and easier, thus, saving efforts. IDEs also help correct errors and show
where the code is wrong.
In Python, the most frequently used IDEs include Spyder, Jupyter, PyCharm, IDLE and Atom.
For the course, we will be using Jupyter, which is part of the Anaconda distribution.

 Anaconda Distribution:
Anaconda distribution is a Python and R data science distribution. It is easy to download and
is open source. It has over 7500 packages. A package is a collection of modules. All of it
freely available and Anaconda also provides community support which is available for all
python related queries one has.
Steps to Install Anaconda:

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by saadsheriff1895@gmail.com only.


Sharing or publishing the contents in part or full is liable for legal action.
 Go to the anaconda website. https://www.anaconda.com/products/individual-d

On the website, click on download for your respective operating system (i.e., Windows,
Mac, Linux)

 The site should give you a prompt to save the file, select the location where you
saadsheriff1895@gmail.com
J732KOTCSB want to place the file.
 Once downloaded, open it. You should see a prompt like this. Click on next.

 Click on ‘I agree’ and do not change any settings/presets that are there. Click on
Next. Specify a destination on the computer. Click Next and it should start the
installation. Once done, click on Next.

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by saadsheriff1895@gmail.com only.


Sharing or publishing the contents in part or full is liable for legal action.
 Click on Next once again. And click on Finish.

saadsheriff1895@gmail.com
J732KOTCSB

Once you are done downloading the Anaconda Navigator, you will be redirected to a
website. For tutorials you can glance over the website and explore.

LAUNCHING A JUPYTER NOTEBOOK


 Go on your search bar, and search for the Anaconda Navigator you just downloaded.
It takes a while to open.
 You must see a screen like this:

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by saadsheriff1895@gmail.com only.


Sharing or publishing the contents in part or full is liable for legal action.
These are some of the applications that are part of the Anaconda distribution by default.

 Go to Jupyter Notebook and click on Launch.


 You should be redirected to a website

saadsheriff1895@gmail.com
J732KOTCSB

The site’s URL is http://localhost:8888/tree

The ‘8888’ part in the URL might change if another notebook is open in the background.
The files shown on the page are ones that are there on your computer

 To open a Jupyter notebook:

Go to New, click on ‘Python 3’ under the Notebook tab.


Once you click Python 3, another tab opens and you can see the Notebook window.

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by saadsheriff1895@gmail.com only.


Sharing or publishing the contents in part or full is liable for legal action.
Parts of the notebook window:
 ‘Untitled1’ here is the name of the notebook, you can edit it by double clicking on it
or saving the notebook.
 The checkpoint shows the last time changes were made and saved on the notebook.
 The menu bar is one directly below it, the pane which begins with File. All of those
tabs are used to make changes in the way the notebook works.
saadsheriff1895@gmail.com
J732KOTCSB  The Toolbar lies below the Menu bar. It gives icons to select most used operations by
simply clicking on them, such as new notebook for the ‘+’, Run to run the cell, etc.
 The kernel shows the type of kernel the current notebook uses (i.e. here, Python 3).

There are three types of cells in the Jupyter notebook, namely, Code,
Markdown, and Raw Cells.
 The Code cells are used to write the code and program. It has to be properly
indented and must have clear syntax.
 The Markdown cells are used to document what you write, it is descriptive text.
 Raw cells are a place where you can write the output directly. These cells are not
evaluated. They are like comments.
Every cell is a Code cell by default. One can change its type by the drop down on the
Toolbar.

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by saadsheriff1895@gmail.com only.


Sharing or publishing the contents in part or full is liable for legal action.
Code cell when executed, gives the solution as above. Markdown cell when executed
appears as a note/text.

SHORTCUTS
Operation Shortcut Key
Run Ctrl + Enter
Create a new cell Shift + M
Copy a cell c
Paste cell Shift + v
Delete cell Double click ‘d’
Change type of Cell to: Code Y
Change type of Cell to: Markdown M
Change type of Cell to: Raw Cell R
Save (edit checkpoint) Ctrl + S

saadsheriff1895@gmail.com
J732KOTCSB

Proprietary content. All rights reserved. Unauthorized use or distribution prohibited.

This file is meant for personal use by saadsheriff1895@gmail.com only.


Sharing or publishing the contents in part or full is liable for legal action.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy