Skip to content

Fix Yahoo date parsing with mixed timezone formats#2265

Open
Whning0513 wants to merge 1 commit into
microsoft:mainfrom
Whning0513:fix-yahoo-date-parse-2014
Open

Fix Yahoo date parsing with mixed timezone formats#2265
Whning0513 wants to merge 1 commit into
microsoft:mainfrom
Whning0513:fix-yahoo-date-parse-2014

Conversation

@Whning0513

Copy link
Copy Markdown

Fix Yahoo date parsing with mixed timezone formats

YahooCollectorCN1d.download_index_data calls pd.to_datetime(df['date'])
on timestamps from East Money API that may include timezone offsets
(e.g. ' 09:30:00+08:00'). Similarly, YahooNormalize.normalize_yahoo calls
pd.to_datetime(df.index) on date strings from Yahoo Finance.

Without specifying format='mixed', pd.to_datetime raises when it encounters
mixed formats in the same column — some entries are date-only strings while
others carry timezone info. Adding format='mixed' lets pandas infer the
format per-entry and parse them correctly.
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.

1 participant