SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
Why Python? (For Stats
People)
@__mharrison__
© 2013
About Me
●

●

●

12+ years Python
Worked in Data Analysis, HA, Search,
Open Source, BI, and Storage
Author of multiple Python Books
Book
Book
Treading on Python Volume 1 meant to
make people proficient in Python quickly
Why Python?
General Purpose Language
“I’d rather do math in a general-purpose
language than do general-purpose
programming in a math language.”
John D Cook
Who's Using Python?
●

Startups (on HN)

●

Data Scientists (Strata)

●

Big Companies
Who
●

Google

●

Nasa

●

ILM

●

Redhat

●

Finance

●

Instagram

●

Pinterest

●

Youtube

●

...
Open Source
Free in both senses of the word
Batteries Included
●

Text

●

Network

●

JSON

●

Command Line

●

Files

●

XML
Large Community
PyPi - PYthon Package Index
●

Web

●

Database

●

GUI

●

Scientific

●

Network Programming

●

Games
Large Community
●

User Groups

●

PyLadies

●

Conferences
Local
●

utahpython.org - 2nd Thurs. 7pm

●

Utah Open Source Conference
Tooling
●

Editors

●

Testing

●

Profiling

●

Debugging

●

Documentation
Optimizes for Programmer Time
“We should forget about small
efficiencies, say about 97% of the time:
premature optimization is the root of
all evil.”
Donald Knuth
Executable Pseudocode
function quicksort(array)
if length(array) ≤ 1
return array // an array of zero or one elements is already sorted
select and remove a pivot element pivot from 'array' // see '#Choice of
pivot' below
create empty lists less and greater
for each x in array
if x ≤ pivot then append x to less'
else append x to greater
return concatenate(quicksort(less), list(pivot), quicksort(greater)) //
two recursive calls
http://en.wikipedia.org/wiki/Quicksort
Executable Pseudocode
>>> def quicksort(array):
...
if len(array) <= 1:
...
return array
...
pivot = array.pop(len(array)/2)
...
lt = []
...
gt = []
...
for item in array:
...
if item < pivot:
...
lt.append(item)
...
else:
...
gt.append(item)
...
return quicksort(lt) + [pivot] + quicksort(gt)
But...
Python has Timsort. Optimized for real
world (takes advantage of inherent order)
and written in C. (Stolen by Java,
Android, and Octave)
Multi-paradigm Languange
●

Imperative

●

Object Oriented

●

Functional
Imperative
>>> def sum(items):
...
total = 0
...
for item in items:
...
total = total + item
...
return total
>>> sum([2, 4, 8])
14
OO
>>> class Summer:
...
def __init__(self):
...
self.items = []
...
def add_item(self, item):
...
self.items.append(item)
...
def sum(self):
...
return sum(self.items)
>>>
>>>
>>>
>>>
5

s = Summer()
s.add_item(2)
s.add_item(3)
s.sum()
Functional
>>> import operator
>>> sum = lambda x: reduce(operator.add, x)
>>> sum([4, 8, 22])
34
Why Not Python?
Slow
Sometimes you have to optimize. Good C
integration
If it ain't broke don't fix it
Don't replace existing solutions for fun
R has more depth
Though Python is catching up in some
areas
Going Forward
IPython Notebook
●

Notebook w/ integrated graphs
Libraries
●

Numpy - matrix math

●

scipy - scientific libraries

●

scipy.stats - stats

●

statsmodel - modeling

●

pandas - dataframe

●

matplotlib - graphing

●

scikit.learn - ml
That's all
Questions? Tweet me
For beginning Python secrets see
Treading on Python Volume 1
@__mharrison__
http://hairysun.com

Contenu connexe

Tendances

Tendances (20)

Let’s Learn Python An introduction to Python
Let’s Learn Python An introduction to Python Let’s Learn Python An introduction to Python
Let’s Learn Python An introduction to Python
 
Python basic
Python basicPython basic
Python basic
 
python.ppt
python.pptpython.ppt
python.ppt
 
Learn Python The Hard Way Presentation
Learn Python The Hard Way PresentationLearn Python The Hard Way Presentation
Learn Python The Hard Way Presentation
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
 
Python basics_ part1
Python basics_ part1Python basics_ part1
Python basics_ part1
 
Introduction to Python for Bioinformatics
Introduction to Python for BioinformaticsIntroduction to Python for Bioinformatics
Introduction to Python for Bioinformatics
 
Python in 30 minutes!
Python in 30 minutes!Python in 30 minutes!
Python in 30 minutes!
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
 
Introduction to Python - Part Two
Introduction to Python - Part TwoIntroduction to Python - Part Two
Introduction to Python - Part Two
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
 
Python Workshop
Python WorkshopPython Workshop
Python Workshop
 
Euro python2011 High Performance Python
Euro python2011 High Performance PythonEuro python2011 High Performance Python
Euro python2011 High Performance Python
 
Python for Beginners(v1)
Python for Beginners(v1)Python for Beginners(v1)
Python for Beginners(v1)
 
Python Basics
Python BasicsPython Basics
Python Basics
 
Python-The programming Language
Python-The programming LanguagePython-The programming Language
Python-The programming Language
 
Python
PythonPython
Python
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming Language
 
Python Presentation
Python PresentationPython Presentation
Python Presentation
 

Similaire à Why Python (for Statisticians)

Python bootcamp - C4Dlab, University of Nairobi
Python bootcamp - C4Dlab, University of NairobiPython bootcamp - C4Dlab, University of Nairobi
Python bootcamp - C4Dlab, University of Nairobi
krmboya
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
 
What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
The Joy of SciPy, Part I
The Joy of SciPy, Part IThe Joy of SciPy, Part I
The Joy of SciPy, Part I
Dinu Gherman
 

Similaire à Why Python (for Statisticians) (20)

Python bootcamp - C4Dlab, University of Nairobi
Python bootcamp - C4Dlab, University of NairobiPython bootcamp - C4Dlab, University of Nairobi
Python bootcamp - C4Dlab, University of Nairobi
 
What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)
 
A first taste of Python and Django
A first taste of Python and DjangoA first taste of Python and Django
A first taste of Python and Django
 
What is Big Data?
What is Big Data?What is Big Data?
What is Big Data?
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
Python For Scientists
Python For ScientistsPython For Scientists
Python For Scientists
 
Learn python
Learn pythonLearn python
Learn python
 
What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)
 
Cluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in CCluj.py Meetup: Extending Python in C
Cluj.py Meetup: Extending Python in C
 
Samsung SDS OpeniT - The possibility of Python
Samsung SDS OpeniT - The possibility of PythonSamsung SDS OpeniT - The possibility of Python
Samsung SDS OpeniT - The possibility of Python
 
London level39
London level39London level39
London level39
 
Basic of python for data analysis
Basic of python for data analysisBasic of python for data analysis
Basic of python for data analysis
 
Python for PHP developers
Python for PHP developersPython for PHP developers
Python for PHP developers
 
Pycon tw 2013
Pycon tw 2013Pycon tw 2013
Pycon tw 2013
 
First Steps in Python Programming
First Steps in Python ProgrammingFirst Steps in Python Programming
First Steps in Python Programming
 
A Python Tutorial
A Python TutorialA Python Tutorial
A Python Tutorial
 
The Joy of SciPy, Part I
The Joy of SciPy, Part IThe Joy of SciPy, Part I
The Joy of SciPy, Part I
 
Introduction to Python Objects and Strings
Introduction to Python Objects and StringsIntroduction to Python Objects and Strings
Introduction to Python Objects and Strings
 
Dynamic Python
Dynamic PythonDynamic Python
Dynamic Python
 
Python memory managment. Deeping in Garbage collector
Python memory managment. Deeping in Garbage collectorPython memory managment. Deeping in Garbage collector
Python memory managment. Deeping in Garbage collector
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Why Python (for Statisticians)