我有一个系列,其索引是datetime我想绘制的.我想在y轴上绘制系列的值,在x轴上绘制系列的索引.该Series如下外观:
2014-01-01 7
2014-02-01 8
2014-03-01 9
2014-04-01 8
...
Run Code Online (Sandbox Code Playgroud)
我使用生成图表plt.plot(series.index, series.values).但图表看起来像:
问题是我想只有年和月.但是,图表包含小时,分钟和秒.如何删除它们以便获得所需的格式?
当我们:在两个字符之间放一个冒号时是什么意思?我确信这不是说从角色A到角色B.
这是代码:
fit9=lm(Sales~.+Income:Advertising+Price:Age,data=Carseats)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.5755654 1.0087470 6.519 2.22e-10 ***
CompPrice 0.0929371 0.0041183 22.567 < 2e-16 ***
Income 0.0108940 0.0026044 4.183 3.57e-05 ***
Advertising 0.0702462 0.0226091 3.107 0.002030 **
Population 0.0001592 0.0003679 0.433 0.665330
Price -0.1008064 0.0074399 -13.549 < 2e-16 ***
ShelveLocGood 4.8486762 0.1528378 31.724 < 2e-16 ***
ShelveLocMedium 1.9532620 0.1257682 15.531 < 2e-16 ***
Age -0.0579466 0.0159506 -3.633 0.000318 ***
Education -0.0208525 0.0196131 -1.063 0.288361
UrbanYes 0.1401597 0.1124019 1.247 0.213171
USYes …Run Code Online (Sandbox Code Playgroud)