[BUG] plot_series inconsistent date/time index
See original GitHub issueDescribe the bug
To Reproduce
y = load_airline()
y = y[:48]
fh=np.arange(1, 13)
y_train, y_test = temporal_train_test_split(y, test_size=len(fh))
plot_series(y_train, y_test, labels=["y_train", "y_test"]);
print(y.shape, y_train.shape[0], y_test.shape[0])
print(y.index)
(48,) 36 12 PeriodIndex([β1949-01β, β1949-02β, β1949-03β, β1949-04β, β1949-05β, β1949-06β, β1949-07β, β1949-08β, β1949-09β, β1949-10β, β1949-11β, β1949-12β, β1950-01β, β1950-02β, β1950-03β, β1950-04β, β1950-05β, β1950-06β, β1950-07β, β1950-08β, β1950-09β, β1950-10β, β1950-11β, β1950-12β, β1951-01β, β1951-02β, β1951-03β, β1951-04β, β1951-05β, β1951-06β, β1951-07β, β1951-08β, β1951-09β, β1951-10β, β1951-11β, β1951-12β, β1952-01β, β1952-02β, β1952-03β, β1952-04β, β1952-05β, β1952-06β, β1952-07β, β1952-08β, β1952-09β, β1952-10β, β1952-11β, β1952-12β], dtype=βperiod[M]β, name=βPeriodβ, freq=βMβ)
Expected behavior The X-axis should go till end of 1952. The X-axis on the plot does not reflect the indices correctly. It should go till 1952, but shows values only till 1949
Versions System: python: 3.6.12 |Anaconda, Inc.| (default, Sep 9 2020, 00:29:25) [MSC v.1916 64 bit (AMD64)] executable: C:\Users\xxxx\AppData\Local\Continuum\anaconda3\envs\sktime\python.exe machine: Windows-10-10.0.18362-SP0
Python dependencies: pip: 20.3 setuptools: 49.6.0 sklearn: 0.23.2 numpy: 1.19.2 scipy: 1.5.2 Cython: 0.29.17 pandas: 1.1.3 matplotlib: 3.3.2 joblib: 0.17.0 numba: None pmdarima: 1.7.1 tsfresh: None
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (1 by maintainers)
If youβre interested in looking into this, Iβd appreciate a PR!
I can try to fix this!