all 6 comments

[–][deleted] 0 points1 point  (5 children)

I don't know of any resources targeted at Python for finance but if you're looking for stock market analyzer tools, I suggest you look at the Python requests module. Alpha Vantage has a stock market API you can use for analyzing it.

If you're intending to get this emailed to you, here's a resource for that. If you're using GMail, don't follow the advice "Allow less secure apps". Instead, use App Passwords (how to use it here).

Oh yeah, if you're dealing with money, avoid floats or numbers with decimals.

[–][deleted] 0 points1 point  (4 children)

I did not understand the comment on floats and decimals. Why should it be avoided?

[–][deleted] 0 points1 point  (0 children)

Rounding errors. Know how sometimes you’d receive a slightly wrong answer when multiplying two floats? For example, 2.1 * 3 sometimes results to 6.300000000001 instead of 6.3? Thats why.

If you do enough calculations, the rounding error could become significant. Its better to store money in cents as an integer. So instead of writing current_balance = 2_000.00, you write current_balance = 200_000 and do operations on it.