Skip to content

Commit

Permalink
Update processor_yahoofinance.py (#1299)
Browse files Browse the repository at this point in the history
Fix Multi-Level Column Names in DataFrame Downloaded using processor_yahoofinance.py
  • Loading branch information
Nitasurin authored Dec 13, 2024
1 parent 083192a commit df93fa4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions finrl/meta/data_processors/processor_yahoofinance.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def download_data(
interval=self.time_interval,
proxy=proxy,
)
if temp_df.columns.nlevels != 1:
temp_df.columns = temp_df.columns.droplevel(1)

temp_df["tic"] = tic
data_df = pd.concat([data_df, temp_df])
current_tic_start_date += delta
Expand Down

0 comments on commit df93fa4

Please sign in to comment.