question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] plot_series inconsistent date/time index

See original GitHub issue

Describe 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

image

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:closed
  • Created 3 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mloningcommented, Jan 15, 2021

If you’re interested in looking into this, I’d appreciate a PR!

1reaction
gracewgaocommented, Dec 11, 2020

I can try to fix this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] plot_series inconsistent date/time index #519 - GitHub
I have a similar issue appearing in 0.5.2. Python 3.8. Mac OS. import sktime sktime.__version__ # returns '0.5.2'.
Read more >
Time-series plotting inconsistencies in Pandas - Stack Overflow
I have been struggling with to or not to consider it as a bug, as you see, the problem boils down to the...
Read more >
Time series / date functionality β€” pandas 1.5.2 documentation
DatetimeIndex objects have all the basic functionality of regular Index objects, and a smorgasbord of advanced time series specific methods for easy frequencyΒ ......
Read more >
How to Load and Explore Time Series Data in Python
As an index, there can be multiple values for one time, and values may be spaced evenly or unevenly across times. The main...
Read more >
Changelog β€” sktime documentation
[BUG] fixed erroneous index coercion in convert_align_to_align_loc ... This was inconsistent previously between types of transformers: theΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found