0% found this document useful (0 votes)
8 views36 pages

Lecture 1

The document outlines a course on Programming for Data Science using Python, taught by Sayed Mortaza Kazemi. It covers programming fundamentals, the history and applications of Python in data science, and the advantages of using Python over other programming languages. The course aims to familiarize students with Python's syntax, libraries, and real-world applications in data processing, statistical analysis, and machine learning.

Uploaded by

Milad razi
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)
8 views36 pages

Lecture 1

The document outlines a course on Programming for Data Science using Python, taught by Sayed Mortaza Kazemi. It covers programming fundamentals, the history and applications of Python in data science, and the advantages of using Python over other programming languages. The course aims to familiarize students with Python's syntax, libraries, and real-world applications in data processing, statistical analysis, and machine learning.

Uploaded by

Milad razi
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

Programming For Data Science

(Python)

Introduction to Programming for Data Science


Info:
• Instructor: Sayed Mortaza Kazemi
• Office Phone: 0795474969
• Email: sayedmortaza11@[Link] / [Link]@[Link]

2019 - Modern Programming (Java) 1-2


Course Introduction and Overview

Objective:
• Provide an understanding of programming fundamentals for data science.
Topics Covered:
• Basics of programming, history, applications, and an introduction to Pytho
Expected Outcomes:
• Understand the role of programming in data science.
• Get familiar with Python as a primary tool.
• Explore real-world applications
History of Programming for Data Science

• Early Days: Use of programming languages like FORTRAN and C for data analysis.
• Statistical Software: Introduction of R, SAS, and MATLAB for statistical
computing.
• Rise of Python: Emerged as a leading language due to its simplicity and extensive
libraries.
• Modern Era: Integration of AI, big data processing, and cloud computing.
Applications of Programming in Data Science

• Data Processing: Cleaning and transforming large datasets.


• Statistical Analysis: Performing inferential and descriptive statistics.
• Machine Learning: Building predictive models using frameworks like scikit-learn.
• Visualization: Using tools like Matplotlib and Seaborn to interpret data.
• Big Data Handling: Working with frameworks like Spark and Hadoop.
Introduction to Python Programming
Language

Why Python?
• Easy-to-read syntax.
• Large community support.
• Extensive data science libraries (NumPy, Pandas, Matplotlib, Scikit-learn,
TensorFlow)
Basic Syntax:
• Variables and Data Types
• Control Structures (if-else, loops)
• Functions and Modules
• Data Structures (Lists, Tuples, Dictionaries)
What is Python Programming language

• What is Python programming Language?

• Python is a High-level programming language for general-purpose programming,


created by Guido van Rossum and first released in 1991.
Why python?

• Developer Productivity (1/3—1/5 of others), Runs Immediately


• Support libraries
• Component integration
• Data Science, Gaming, Robots etc..
• It’s Mixable
Companies that use python
Contd..
History of Python

• Started implementation at year 1989 by Guido van Rossom , Netherlands


• Python 2.0 was released on October 16, 2000
• Latest version for Python 2.7 is July,3, 2010
• Python 3.0, a major, backwards-incompatible release, was released on December
3, 2008
• Latest version for Python 3.12.2 (06 Feb 2024)
Python 2 vs Python 3

• Companies have been moving from Python 2 to 3


• Although Python 2.7 is still widely used, Python 3 adoption is growing quickly.
• Python 2.7 will “retire” and no longer be maintained …2020
Contd..
Python Compared to Java
Python Compared to Java
Python Compared to Other
Features of Python
Easyt
a. Easy to Code
• Compared to other popular languages like Java and C++, it is
easier to code in Python. Anyone can learn Python syntax in just a
few hours. Mastering Python requires learning about all its
advanced concepts and packages and modules, and it is
programmer-friendly.
b. Easy to Read
• Being a high-level language, Python code is quite like English.
Looking at it, you can tell what the code is supposed to do. Also,
since it is dynamically-typed, it mandates indentation. This aids
readability.
Expressive

• Python provides us with a countless number of constructs


that help us focus on the solution rather than on the
syntax. This is one of the outstanding python features that
tell you why you should learn Python.
• Suppose we have two languages A and B, and all programs
that can be made in A can be made in B using local
transformations. However, there are some programs that
can be made in B, but not in A, using local
transformations. Then, B is said to be more expressive
than A.
High-Level, Free and Open-Source
• Python is freely available. You can download it from the Python
Website. It is open-source. This means that its source code is
available to the public. You can download it, change it, use it, and
distribute it. This is called FLOSS(Free/Libre and Open Source
Software).
• It is a high-level language. This means that as programmers, we
don’t need to remember the system architecture. Nor do we
need to manage the memory. This makes it more programmer-
friendly and is one of the key python features.
Portable

• Assume you’ve written a Python code for your Windows


machine. Now, if you want to run it on a Mac, you don’t
need to make changes to it for the same. In other words,
you can take one code and run it on any machine, there is
no need to write different code for different machines.
This makes Python a portable language. However, you
must avoid any system-dependent features in this case.
Interpreted

• Languages like C++ or Java, you must first compile it, and then run
it. But in Python, there is no need to compile it. Internally, its
source code is converted into an immediate form called bytecode.
So, all you need to do is to run your Python code without
worrying about linking to libraries, and a few other things.
• By interpreted, we mean the source code is executed line by line,
and not all at once. Because of this, it is easier to debug your
code. Also, interpreting makes it just slightly slower than Java, but
that does not matter compared to the benefits it has to offer.
Object-Oriented, Extensible
• A programming language that can model the real world is said to
be object-oriented. It focuses on objects and combines data and
functions. Contrarily, a procedure-oriented language revolves
around functions, which are code that can be reused. Python
supports both procedure-oriented and object-oriented
programming which is one of the key python features. It also
supports multiple inheritances, unlike Java. A class is a blueprint
for such an object. It is an abstract data type and holds no values.
• If needed, you can write some of your Python code in other
languages like C++. This makes Python an extensible language,
meaning that it can be extended to other languages.
Embeddable, Large Standard Library

• It is possible to put our Python code in a source code in a


different language like C++. This allows us to integrate scripting
capabilities into our program of the other language.
• Python downloads with a large library that you can use so you
don’t have to write your own code for every single thing. There
are libraries for regular expressions, documentation-generation,
unit-testing, web browsers, threading, databases, CGI, email,
image manipulation, and a lot of other functionality.
GUI Programming, Dynamically Typed

• A software is not user-friendly until its GUI is made. A user can


easily interact with the software with a GUI. Python offers various
libraries for making Graphical user interface for your applications.
For this, you can use Tkinter, PyQT, wxPython or JPython. These
toolkits allow you for easy and fast development of GUI.

• Python is dynamically-typed. This means that the type for a value


is decided at runtime, not in advance. This is why we don’t need
to specify the type of data while declaring it.
How Python Programs Run

• There is a software package called an interpreter. An interpreter is


a kind of program that executes other programs.

• It is a layer of software logic between your code and the


computer Hardware
Contd..
• For ex:
• print (‘ My First Python Program’)

• 1. The interpreter changes it to bytecode…


• 2. The bytecode is executed by Python Virtual Machine (PVM)
Variable Assignment
• We use the assignment operator (=) to assign values to a variable. Any type of
value can be assigned to any valid variable.
How to write a Program in Python

Run your First Python Program


How to run a Python Program?
• Install Anaconda Software, Thonney or Python IDLE
• Steps:
• Visit [Link]/downloads
• Select Windows
• Download the .exe installer
• Open and run the .exe installer
• Open the Anaconda Navigator
• Select Jupyter Notebook
• Run the python code
Jupyter Notebook
Writing the code
Thank You

You might also like