ECON 370 Quantitative Economics With Python
ECON 370 Quantitative Economics With Python
Spring 2016
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Agenda ...
1. Course Assesment
2. Assignments
3. Python Fundamentals
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Course Assesment
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Assignments
They are designed to help you with your preparation for the midterm
and final exams.
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Assignments
1. Go to https://github.com/mmcky/nyu-econ-370/
2. Click on assignments
3. Click on assignment document (i.e. assignment-1.pdf)
4. Click on RAW and it will download a copy to your computer
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Issues and Topics of Coversation ...
Feel free to post any programming issues or problems using the Issue
Tracker.
We can use this as a Forum where we can help each other out
answering questions etc.
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Jupyter
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Intro to Python Topics
1. Introductory Example
2. Basic Structure of a Python Program
3. Variables
4. Data Types
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Python Fundamentals
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Order of Operations
1. Parentheses
2. Exponentiation
3. Multiplication and Division
4. Addition and Subtraction
Note: Operators that share precedence are then evaluated from left
to right.
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
How are numbers stored by a computer?
Example: 10112
Very useful when using Boolean Logic (True and False).
Conversion:
10112 = 1 ∗ 23 + 0 ∗ 22 + 1 ∗ 21 + 1 ∗ 20 = 8 + 0 + 2 + 1 = 1110
Others: Hexa-Decimal, Octal
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Numbers and Precision ...
Example:
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Floating Point Numbers
Example:
In [8]: 1/3
Out[8]: 0.3333333333333333
In [10]: math.pi
Out[10]: 3.141592653589793
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Floating Point Numbers
Example:
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Python Floating Point Limitations
https://docs.python.org/3.5/tutorial/floatingpoint.html
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .
Additional References
Additional References:
. . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . .