-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
pd.date_range Attribute_Error #5200
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
Comments
That is quite ineffficient as you'd have to construct the entire series. Try this instead.
|
Thanks so much! On Sat, Oct 12, 2013 at 7:04 PM, jreback notifications@github.com wrote:
|
Actually, I just noticed this below. Does that make sense to you? I would think all three should be 3, but notice one result is 4. In [475]: a = pd.Period(pd.Timestamp('2013-10-1'), freq='B')
In [476]: b = pd.Period(pd.Timestamp('2013-10-4'), freq='B')
In [477]: b - a
Out[477]: 3L
In [478]: b = pd.Period(pd.Timestamp('2013-10-5'), freq='B')
In [479]: b - a
Out[479]: 4L
In [480]: b = pd.Period(pd.Timestamp('2013-10-6'), freq='B')
In [481]: b - a
Out[481]: 3L
In [482]: |
This I think is the problem: In [485]: b = pd.Period(pd.Timestamp('2013-10-4'), freq='B')
In [486]: b
Out[486]: Period('2013-10-04', 'B')
In [487]: b = pd.Period(pd.Timestamp('2013-10-5'), freq='B')
In [488]: b
Out[488]: Period('2013-10-07', 'B')
In [489]: b = pd.Period(pd.Timestamp('2013-10-6'), freq='B')
In [490]: b
Out[490]: Period('2013-10-04', 'B')
In [491]: |
that is correct, business days are not on weekends (10/6) is a sunday |
Right, but why does b = pd.Period(pd.Timestamp('2013-10-5'), freq='B') round up to 10-7-13, but b = pd.Period(pd.Timestamp('2013-10-6'), freq='B') rounds down to 10-4-13? |
might be a bug.....will create an issue about it.... |
Thanks! On Sat, Oct 12, 2013 at 7:47 PM, jreback notifications@github.com wrote:
|
see #5203 |
I'm using pandas 0.12 and numpy 1.7.1.
I'm trying to calculate the number of business days between two columns of dates. Not all rows have valid dates though, and pd.date_range does not have an ignore errors option, so I'm getting this error:
The text was updated successfully, but these errors were encountered: