-
Notifications
You must be signed in to change notification settings - Fork 678
Strike prices > 1k are returned as strings #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here is a way to reproduce: from pandas_datareader import data
opt = data.Options("GOOG", "yahoo")
opt.get_call_data() # opt.get_all_data()
opt.calls180119.index.levels[0] + 0.5 it raises TypeError: Can't convert 'float' object to str implicitly We might have a look at There is two way to fix this
We ever have some problems with locale see #63 This issue could be an occasion to fix it! Maybe we should use a context manager to save user local, set user locale to english and performs string to number conversion and then go back to user local. I'm aware that's not the easiest way to fix this issue but that's probably the cleanest. |
While I haven't looked at the code that initially creates the options DataFrame, I don't see how it could be otherwise than having strike be a string in the early stages of the creation process. I would think the easiest (and adequately performant) way to do it would be just to strip commas out of the string before attempting to convert to float. If |
In the Google options processing, I decided to process as |
When trying to pull call strikes from Yahoo! Finance, I'm getting for 'GOOGL' as strike:
When I print out the value for straddle['strike'], which is the df pulled from yahoo finance, I get:
1,040.00
. It looks like the comma from Yahoo is not allowing casting as float.The text was updated successfully, but these errors were encountered: