ons
Introduction to Python
Mahesh Mohan M R
Centre of Excellence in AI
Indian Institute of Technology Kharagpur
Python
● Created in 1990 by Guido van Rossum
Python: Fun to Use
● Created in 1990 by Guido van Rossum
● Named after Monty Python
BBC show “Monty Python’s Flying Circus”
vs
Python: Fun to Use
Source: A practical intro to Python 3, 4th edition, Real python
Python: Fun to Use
1. An easy and intuitive language
2. Open source :)
3. Code that is as understandable as plain English
4. Suitability for all fields, and everyday tasks.
Python Highlights
● Easily extended with new functions and data types implemented in C or C++
● Available on Windows, Mac OS X, and Unix operating systems
● Allows you to split your program into modules that can be reused.
● Comes with a large collection of standard modules
Matrices/vectors and Data Manipulation and Plotting Data and Results
Mathematical functions Analysis
Machine learning library Deep learning library
Matrices/vectors and Data Manipulation and Plotting Data and Results
Mathematical functions Analysis
Machine learning library Deep learning library
https://docs.python.org/3/
Running Python
● Python is pre-installed on most Unix systems
● Download from http://python.org/downloads/ and google
● Python comes with a large library of standard modules
● There are several options for an IDE
○ Pycharm – works well with Windows, Linux and Mac
○ Shell with your favorite text editor
○ Jupyter notebook
○ ……….. Lots and Lots ……….
In the Lab tutorials, we use Google Collab
Installation and Run in Installation
your Computer and Run in
Google Suite
Google Collab
Quick Intro to Google Collab
● Access Google Colab at colab.research.google.com
1. Upload datasets
2. Adding libraries
3. Run Cell
4. Table of contents
5. Menu Bar (upload/open
a notebook)
6. Fine name (.ipynb)
7. Insert code cell
8. Insert Text cell
9. Cell (write your code)
10. Output (including error)
11. Clear Output
Reference: https://runestone.academy/ns/books/published/httlads/PythonReview/google_colab.html
Quick Intro to Python
Quick Intro to Python Functions
Data Manipulation and Data Manipulation and
Analysis Analysis
Matrices/vectors and
Mathematical functions
Plotting Data and Results Plotting Data and Results
Quick Intro to Numpy
● Popular library for storing arrays of numbers and performing computations on them.
● Run faster, since most NumPy routines are implemented in C for speed.
Quick Intro to Numpy
● Popular library for storing arrays of numbers and performing computations on them.
● Run faster, since most NumPy routines are implemented in C for speed.
Quick Intro to
Quick Intro to
Quick Intro to
Some examples of Figs generated using Matplotlib