Skip to content

Commit

Permalink
Merge pull request #252 from pmorissette/tkp/yfnew
Browse files Browse the repository at this point in the history
bugfix for newer ffn returning dfs instead of series
  • Loading branch information
timkpaine authored Nov 2, 2024
2 parents 147dd54 + afdf39e commit f436bdf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
19 changes: 3 additions & 16 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,14 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
- OS: [e.g. MacOS]
- Library Version [e.g. `0.1.1`]
- Python Version [e.g. `3.9`]

**Additional context**
Add any other context about the problem here.
4 changes: 4 additions & 0 deletions ffn/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ def get(
data[ticker] = provider(ticker=t, field=f, **kwargs)

data[ticker] = data[ticker][~data[ticker].index.duplicated(keep="last")]
if isinstance(data[ticker], pd.DataFrame):
# newer yfinance returns as dataframe,
# convert to series
data[ticker] = data[ticker][data[ticker].columns[0]]

df = pd.DataFrame(data)

Expand Down

0 comments on commit f436bdf

Please sign in to comment.