Top Banner
Amaral Lab 0 Introduction to Data Science March 2015 Luís A. Nunes Amaral Why Python?
29

Why Python?

Jul 15, 2015

Download

Technology

Adam Pah
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Why Python?

Amaral Lab 0

Introduction to Data ScienceMarch 2015

Luís A. Nunes Amaral

Why Python?

Page 2: Why Python?

Amaral Lab 1

Employer needs

Results based on hundreds of thousands of data points collected by processing 600,000+ coding tests and challenges by 2,000+ employers.

Page 3: Why Python?

Amaral Lab 2

Employer needs

Growing:CC#JavascriptPython

Shrinking:C++ (20%)Java (17%)PerlRuby (28%)

Python top-ranked language fourth year in a row!

Page 4: Why Python?

Amaral Lab 3

Search engine popularity

The TIOBE Programming Community index is an indicator of the popularity of programming languages

Page 5: Why Python?

Amaral Lab 4

Developer activity

1. JavaScript2. Java3. PHP4. Python5. C#5. C++5. Ruby8. CSS9. C10. Obj-C11. Perl11. Shell13. R14. Scala15. Haskell16. Matlab17. Vis. Basic GitHub

Sta

ck

Ove

rflo

w

Page 6: Why Python?

Amaral Lab 5

We all need help

Page 7: Why Python?

Amaral Lab 6

Code is more often read than written

http://docs.python-guide.org/en/latest/writing/style/

Page 8: Why Python?

Amaral Lab 7

Code is more often read than written

Page 9: Why Python?

Amaral Lab 8

Code is more often read than written

Page 10: Why Python?

Amaral Lab 9

Code is more often read than written

Page 11: Why Python?

Amaral Lab 10

Python

Guido van Rossum

Language was named after Monty Python’s Flying Circus

Page 12: Why Python?

Amaral Lab 11

A high level of readability is at the heart of the design of the Python

language

http://docs.python-guide.org/en/latest/writing/style/

Page 13: Why Python?

Amaral Lab 12

One reason for Python code to be easily read and understood is its

relatively complete set of Code Style guidelines and “Pythonic” idioms.

Page 14: Why Python?

Amaral Lab 13

Perl vs. Python

Perl: "There's more than one way to do it.”(also: "There's more ways to do it than you can remember, probably more than you can even recognize.”)

Python: "There should be one -- and preferably only one -- obvious way to do it.”

Page 15: Why Python?

Amaral Lab 14

Perl vs. Python

Perl: ”Look how smart I am.”

Python: ”If you can understand what I did, we can make something better.”

Page 16: Why Python?

Amaral Lab 15

Language strengths

C: Simple, fast and flexible. Makes for smaller programs. (1989)

C++: Great for large complex projects because it is object-oriented. (1998)

FORTRAN: Very fast. Perfect for number crunching. (1966)

Javascript: Website development. (1997)

Page 17: Why Python?

Amaral Lab 16

Language strengths

Java: Multiplatform, portable. Similar to C++.

Mathematica: Symbolic calculations.

Matlab: Domain specific number crunching.

PHP: Scripting language for website development.

Python: Multi-purpose language. Highly-readable. Extremely flexible.

Page 18: Why Python?

Amaral Lab 17

A high level of readability is at the heart of the design of the Python

language

http://docs.python-guide.org/en/latest/writing/style/

Page 19: Why Python?

Amaral Lab 18

The Zen of Python

Beautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.

Flat is better than nested.Sparse is better than dense.

Readability counts.

Special cases aren't special enough to break the rules.Although practicality beats purity.

Errors should never pass silently.Unless explicitly silenced.

Page 20: Why Python?

Amaral Lab 19

The Zen of Python

In the face of ambiguity, refuse the temptation to guess.

There should be one-- and preferably only one --obvious way to do it.Although that way may not be obvious at first unless you're Dutch.

Now is better than never.Although never is often better than *right* now.

If the implementation is hard to explain, it's a bad idea.If the implementation is easy to explain, it may be a good idea.

Namespaces are one honking great idea -- let's do more of those!

https://www.python.org/dev/peps/pep-0020/http://programmers.stackexchange.com/questions/148790/is-the-14th-line-of-the-zen-of-python-a-reference-to-dijkstra

Page 21: Why Python?

Amaral Lab 20

Python is extremely flexible

Page 22: Why Python?

Amaral Lab 21

Web development

Page 23: Why Python?

Amaral Lab 22

Web development

Page 24: Why Python?

Amaral Lab 23

Scientific computing

Page 25: Why Python?

Amaral Lab 24

Statistical analysis

Page 26: Why Python?

Amaral Lab 25

Machine learning

Page 27: Why Python?

Amaral Lab 26

Database interaction

Page 28: Why Python?

Amaral Lab 27

Database interaction

Page 29: Why Python?

Amaral Lab 28

Artificial intelligence