开发者

pandas converting EXCEL date '1/0/1900' to ' 00:00:00'

I have this excel file that is being read by pandas into a dataframe , then output the dataframe contents to snowflake table.

I see that the excel date field with this (invalid) date value of '1/0/1900' is showing up in snowflake as '00:00:00' - while valid dates like '1/15/2022' is showing up in snowflake as '2022-01-16 00开发者_JS百科:00:00'. The snowflake date column is defined as a VARCHAR.

How do I code pandas in such a way that:

excel (invalid) date 1/0/1900 ---> snowflake date (varchar) field should show NULL (expected result)

excel date 1/15/2022 ---> snowflake date (varchar) field should show '2022-01-15' (expected result)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜