0

这个图书馆的超级粉丝,期待更多地使用它

目前只是有一个问题,我希望得到帮助 - 我正在显示的这个数据集的日期格式是 YY-MM,并希望将其反转为与英国格式一致 - 月/年而不是当前的年/月。

有人可以帮我吗?我认为 set_xaxis_tick_format 可以解决此问题,但不能在 ch 中调用它(AttributeError: 'Chart' object has no attribute 'set_xaxis_tick_format')

当前代码:(与示例差别不大)

ch.set_xaxis_tick_format('%m-%Y')
ch.set_title("Sales")
ch.set_subtitle("A")

ch.plot.line(
    # Data must be sorted by x column
    data_frame=price_by_date.sort_values('SALE_DATE'),
    x_column='SALE_DATE',
    y_column='SALES')

ch.show('svg')
4

0 回答 0