Skip to content
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

Fix pandas warning when retrieving quotes. #1672

Merged
merged 1 commit into from
Sep 1, 2023
Merged

Fix pandas warning when retrieving quotes. #1672

merged 1 commit into from
Sep 1, 2023

Conversation

difelice
Copy link
Contributor

@difelice difelice commented Sep 1, 2023

Issue

Retrieving quotes by indexes but not using pandas iloc method, which show a warning:

FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
  if not _np.isnan(quotes["High"][n - 1]):

Changes

  • Modified yfinance/utils.py to fix an issue with retrieving live data from Yahoo Finance.
  • Replaced the use of square brackets with the iloc method to access specific elements in the DataFrame.
  • Updated the code to use iloc instead of indexing with column names.

@difelice difelice changed the base branch from main to dev September 1, 2023 19:06
@difelice difelice marked this pull request as ready for review September 1, 2023 19:08
@ValueRaider ValueRaider merged commit 6cae6d4 into ranaroussi:dev Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants