我想从这个网站上搜一张桌子: https://www.epexspot.com/en/market-data/capacitymarket/capacity-table/
table = pd.read_html("https://www.epexspot.com/en/market-data/capacitymarket")[0]
我要将列更改为格式%y-%m-%d。上表的列应为
2018-09-13, 2018-10-18, 2018-12-13, 2019-03-21, 2019-05-15, 2019-06-27, 2019-09-12
有什么建议吗
通过迭代
table.columns
并使用datetime
模块。只需确保使用replace(year=2019)
,否则将使用默认年份(1900)如果您不喜欢长列表,可以使用
map
:相关问题 更多 >
编程相关推荐