Introduction to Python for Finance

Introduction to Python for Finance

Adina Howe

Associate Professor

Coming up...

histogram

PE_ratio

Introduction to Python for Finance

Why Python for Finance?

  • Easy to Learn and Flexible
    • General purpose
    • Dynamic
    • High-level language
  • Integrates with other languages
  • Open source
    • Accessible to anyone

 

python logo

Introduction to Python for Finance

$$ Datacamp Screenshot

Introduction to Python for Finance

Common mathematical operators

Operator Meaning
+ Add
- Subtract
* Multiply
/ Divide
% Modulus (remainder of division)
** Exponent
Introduction to Python for Finance

Common mathematical operators

# Print the sum of 8 and 4
print(8 + 4)
12
# Print 8 divided by 4
print(8 / 4)
2
  • Explicitly use print()
Introduction to Python for Finance

Any comments?

# Print 8 divided by 2
print(8 / 2)

# Print 2 raised to the power of 2
print(2**2)

# Print 1.0 add 0.10
print(1.0 + 0.10)
Introduction to Python for Finance

Let's practice!

Introduction to Python for Finance

Preparing Video For Download...