Closed VictorHM closed 5 years ago
Hi @Victor,is what you're trying to do convert series to float? if so,i think you keep getting the error because you did not import pandas;much as you have it installed, you still have to import it; import pandas as pd To offer any further help, what were you exactly convert, i mean which columns of data? i hope to hear from you soon.
Hi @Hackingforlife thanks for the answer. I tried as you suggested but still have the same error.
Regarding your question, I just used microsoft.buy_and_hold(start_date='2018-01-01', end_date='2018-01-16', nshares=100)
that contains a conversion of some columns. It is in the library so I didn't try to convert explicitly. I can not offer more info for now until I deep more into the code, as I only skimmed through it briefly.
I think that the conversion that provokes the error is inside Stocker code, in particular it is this line that shows in the error message:
start_price = float(self.stock[self.stock['Date'] == start_date]['Adj. Open'])
I will update as soon as I have more info. Thanks!
You're welcome........Will definitely be waiting for updates.
On Sun, Jan 27, 2019 at 11:59 AM Victor notifications@github.com wrote:
Hi @Hackingforlife https://github.com/Hackingforlife thanks for the answer. I tried as you suggested but still have the same error.
Regarding your question, I just used microsoft.buy_and_hold(start_date='2018-01-01', end_date='2018-01-16', nshares=100) that contains a conversion of some columns. It is in the library so I didn't try to convert explicitly. I can not offer more info for now until I deep more into the code, as I only skimmed through it briefly.
I think that the conversion that provokes the error is inside Stocker code, in particular it is this line that shows in the error message: start_price = float(self.stock[self.stock['Date'] == start_date]['Adj. Open'])
I will update as soon as I have more info. Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/WillKoehrsen/Data-Analysis/issues/32#issuecomment-457900700, or mute the thread https://github.com/notifications/unsubscribe-auth/AfHvDEQr7QI5fsUuXH2EgGw-f3OM0P1Wks5vHWpzgaJpZM4aJttv .
Updated the repo and checked the libs and the error dissapeared. Probably it was something I typed wrong.
Although, for future references, there is still this warning
'datetime.date' is coerced to a datetime. In the future pandas will
not coerce, and a TypeError will be raised. To retain the current
behavior, convert the 'datetime.date' to a datetime with
'pd.Timestamp'.```
Running the first examples of Stocker I got this error regarding float conversion of time series.
It seems related to pandas, the version I have is 0.23.4 as I installed dependencies using conda-forge to make it work (a lot of problems from fbprophet came when I tried to use pip). I will try to find a way to fix this and report back here, but any help will be appreciated as I am quite new to Pandas (and Python in general).