This document provides an overview of programming in Python for data science. It discusses Python's history and timeline, its versatile capabilities across different programming paradigms, and its simple and clear syntax. Key features that make Python popular for data science are highlighted, such as its comprehensive standard library and support for numeric, scientific, and GUI programming. The document also compares Python 2 and 3, describes different ways to run Python programs, and lists popular Python packages for data science. Overall, it serves as an introduction to Python for newcomers and outlines its relevance and widespread adoption in the field of data science.
5. What Can Python Do?
5
Wait! I can do all these things using
other programming languages too! Then
why Python?
Python can be used for
6. Salient Features of Python
Even though there are many
languages Salient features of Python
make it different from others
• Interpreted, very-high-level
programming language.
• Supports a multitude of
programming paradigms.
• OOP, functional, procedural, logic,
etc.
• General purpose.
• Very comprehensive standard
library includes numeric modules,
crypto services, OS interfaces,
networking modules, GUI support,
development tools, etc.
6
8. Features of Python cont. (simplicity)
// HelloWorld Program inC
#include <stdio.h>
Void main()
{
printf(“HelloWorld! n”);
}
// HelloWorld Program inC++
#include <iostream.h>
int main() {
cout << "Hello World!“<<endl;
return 0;
}
8
9. Features of Python cont. (simplicity)
// Hello World Program in Java
class HelloWorld
{
public static void main(String args[])
{
System. out. println(" Hello World!");
}
}
# sample code in Python
print(“Hello World”)
9
13. Python 2x vs Python 3x
▪ F1: Division operator Eg. -7 / 5
▪ F2:I/O functions
▪ F3: str type
▪ F4: xrange() saves memory but doesn’t
support slicing
▪ F5: Error Handling
try:
trying_to_check_error
except NameError, err:
print err, 'Error Caused' # Would not
work in Python 3.x
▪ F6: modules
Feature (Python2x) (Python3x)
F1 Results in -2 Results in -1.4
F2
raw_input()
print “Hello
World”
input()
print (“Hello
World”)
F3 ASCII UNICODE
F4
xrange()
available
xrange()
UNavailable
F5 as not required
Comma
replacedby as
F6
Less
modules
More modules
13
14. 3 Ways of Running a Python Program
▪ Python Shell: An interactive
interpreter. It is pre available in
Linux and Mac OS X
▪ Script mode on cmd
▪ IDE:Atom, IDLE , Jupyter,
Spyder, etc.
.py
Python
Shell
IDE
Script
mode
14
16. How Python is relevant to data science?
What type of data Python supports for data science?
Whom to follow?
Which tools/sites to refer?
Data Science & Python
16
21. Whom to Follow?
Wes McKinney. Creator of pandas, the most widely-used
Python library for data analysis. Author of Python for Data
Analysis. Senior Vice President and Software Architect
at Two Sigma.
Hilary Mason. Founder of Fast Forward Labs. Data
Scientist in Residence at Accel. Founder of HackNY and
co-host of DataGotham
Jake VanderPlas. Author of Python Data Science
Handbook. Senior Data Science Fellow and Director of
Research at the University of Washington's eScience
institute.
https://mode.com/blog/python-influencers/
21
22. Python:When to Use & when Not?
PROS
CONS
Development requirement
Scope
22
24. CONS of Python
• Python is interpreted,so
it's much slower than its
counterparts.
• Weak in mobile
computing, hence not
used much in app
development
• Since Python is dynamic,
more errors show up at
run-time
• Absence of commercial
support
24
25. Programmers Description Example
System Programmers
The system
programmerinstalls,
customizes, and maintains
the operatingsystem, and
also installsor upgrades
products that run on
the system.
•CAD Engineer
•System Engineers
•DevOps Developer
•Software Developer
Web Programmers
A web developer is
a programmerwho engaged
in, the development of
World
WideWeb applications,or
applicationsthat are run
over HTTP, CSS OR HTML
from a web server to
a web browser.
•Frontend Developer
•BackendDeveloper
•Full stack web developer
Types of Computer Science Programmers
25
26. Programmers Description Example
Game Programmers
A game programmer is a
programmerwho develops
codebasesfor
video games or related
software, such
as game development
tools.Game
programminghasmany
specializeddisciplines,allof
which fallunder the “game
programmer”.
•Game Designer
•Audio Engineer
•Lead-Programmer(Games)
•Animators(Games)
ApplicationProgrammers
The application
programmeris a
programmerwho is
responsiblefordesigning
and testing program logic,
codingprograms,program
documentationand
preparationof programs for
computer operations.
•SDE1
•SDE2
•Software Engineer
All Rounder Capable of doingall tasks
•Nerds
•Scientists 26