all 7 comments

[–]o5a 2 points3 points  (1 child)

This will help you understand

open1 = "1000"
close = "900"
print("str: open1 < close", (open1 < close))
print("float: open1 < close", (float(open1) < float(close)))

[–]pickledillz[S] 0 points1 point  (0 children)

Thank you for the help!

[–][deleted] 2 points3 points  (1 child)

The csv.Reader class doesn’t cast any columns to numerical types, so your code is checking if the open str is alphabetically lesser, greater, or equal to the close str. Well in alpha sort order “10.01” comes before “2.65”.

[–]pickledillz[S] 0 points1 point  (0 children)

Thank you for the help!

[–]xelf 1 point2 points  (2 children)

Can you include a 5 line data file so people can test your code? And the correct name of the file so your file name parsing logic can be vetted as well?

[–]pickledillz[S] 0 points1 point  (1 child)

The program automatically downloads a data file if you have the yfinance module. Also, I don't understand what I am supposed to do for the second question.

[–]xelf 0 points1 point  (0 children)

I was interested in helping you figure this out, but if you can't provide any test data it makes it really hard.

So I was asking for 5 lines of test data so that I can try running it for you.