We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This bug exists on the latest version of pandas and might be related to the bug reported in #51425.
df.plot DataFrame with PeriodIndex works well for frequency with n=1, while fоr frequency that multiplies on n>1 we have a shift to the right.
df.plot
PeriodIndex
n=1
n>1
Reproducible Examples:
if freq="7h"
from pandas import * import numpy as np idx = period_range("01/01/2000", freq='7h', periods=4) df = DataFrame( np.array([0, 1, 0, 1]), index=idx, columns=["A"], ) df.plot() print(df)
the plotting starts from 06:00
if freq="2h"
idx = period_range("01/01/2000", freq='2h', periods=4) df = DataFrame( np.array([0, 1, 0, 1]), index=idx, columns=["A"], ) df.plot() print(df)
we have a shift on +1 hour
But if freq="h"
idx = period_range("01/01/2000", freq='h', periods=4) df = DataFrame( np.array([0, 1, 0, 1]), index=idx, columns=["A"], ) df.plot() print(df)
the result looks okay:
Expected Behavior:
I think for both freq="7h" and freq="2h" we should start plotting from the point (00:00, 0.0) as we do for freq="h"
freq="7h"
freq="2h"
(00:00, 0.0)
freq="h"
In case DataFrame with DatetimeIndex plotting works correct, e.g.
DatetimeIndex
idx = date_range("01/01/2000", freq='7h', periods=4) df = DataFrame( np.array([0, 1, 0, 1]), index=idx, columns=["A"], ) df.plot() print(df)
output:
The text was updated successfully, but these errors were encountered:
take
Sorry, something went wrong.
@natmokval should this be closed now that #58322 is merged?
NoelMT
raeef96
Gustaf-Larsson
andrefred
No branches or pull requests
This bug exists on the latest version of pandas and might be related to the bug reported in #51425.
df.plot
DataFrame withPeriodIndex
works well for frequency withn=1
, while fоr frequency that multiplies onn>1
we have a shift to the right.Reproducible Examples:
if freq="7h"
the plotting starts from 06:00
if freq="2h"
we have a shift on +1 hour
But if freq="h"
the result looks okay:
Expected Behavior:
I think for both
freq="7h"
andfreq="2h"
we should start plotting from the point(00:00, 0.0)
as we do forfreq="h"
In case DataFrame with
DatetimeIndex
plotting works correct, e.g.output:

The text was updated successfully, but these errors were encountered: