Skip to content
New issue

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

loffset has no effect when passing in a numyp.timedelta64 #7687

Closed
MarcMassar opened this issue Jul 7, 2014 · 3 comments
Closed

loffset has no effect when passing in a numyp.timedelta64 #7687

MarcMassar opened this issue Jul 7, 2014 · 3 comments

Comments

@MarcMassar
Copy link

@MarcMassar MarcMassar commented Jul 7, 2014

From mailing-list: [https://groups.google.com/forum/#!topic/pydata/CDnF9cNR2ho]
When doing a re-sample, loffset has no effect if a numpy.timedelta64 is passed in:

In [1]: rng = pd.date_range('1/1/2012', periods=4, freq='S')

In [2]: ts = pd.Series(np.random.randint(0, 500, len(rng)), index=rng)

In [3]: ts.resample('2S')
Out[3]:
2012-01-01 00:00:00    396.0
2012-01-01 00:00:02    214.5
Freq: 2S, dtype: float64

In [4]: import datetime

In [5]: ts.resample('2S',loffset=datetime.timedelta(seconds=10))
Out[5]:
2012-01-01 00:00:10    396.0
2012-01-01 00:00:12    214.5
dtype: float64

In [6]: ts.resample('2S',loffset=np.timedelta64(10,'s'))
Out[6]:
2012-01-01 00:00:00    396.0
2012-01-01 00:00:02    214.5
Freq: 2S, dtype: float64
@jreback jreback added this to the 0.15.0 milestone Jul 7, 2014
@jreback
Copy link
Contributor

@jreback jreback commented Jul 7, 2014

would welcome a pull-request for this
also should raise on an invalid loffset

@jreback jreback removed this from the 0.15.0 milestone Sep 8, 2014
@jreback jreback added this to the 0.15.1 milestone Sep 8, 2014
@jreback jreback added this to the 0.15.1 milestone Sep 8, 2014
@jreback jreback removed this from the 0.15.0 milestone Sep 8, 2014
@jreback jreback removed this from the 0.16.0 milestone Mar 6, 2015
@jreback jreback added this to the Next Major Release milestone Mar 6, 2015
@jreback jreback added this to the Next Major Release milestone Mar 6, 2015
@jreback jreback removed this from the 0.16.0 milestone Mar 6, 2015
@jreback jreback removed this from the Next Major Release milestone Dec 10, 2017
@jreback jreback added this to the 0.22.0 milestone Dec 10, 2017
@jorisvandenbossche jorisvandenbossche removed this from the 0.23.0 milestone Mar 29, 2018
@jorisvandenbossche jorisvandenbossche added this to the Next Major Release milestone Mar 29, 2018
@jreback
Copy link
Contributor

@jreback jreback commented Jul 6, 2018

this is already fixed in master, nice to enhance the tests.

@discort
Copy link
Contributor

@discort discort commented Aug 23, 2018

@jreback

this is already fixed in master, nice to enhance the tests.

It's not fixed in master. See PR ^ for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment