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

TimedeltaIndexed Series raises ValueError instead of AttributeError #9680

Closed
JonasAbernot opened this issue Mar 19, 2015 · 4 comments
Closed
Labels
Milestone

Comments

@JonasAbernot
Copy link
Contributor

ts = pd.Series(np.random.normal(size=10),index=pd.timedelta_range(start=0,periods=10,freq='1s'))
ts.foo

raises

ValueError: cannot create timedelta string converter for [foo]

Shouldn't it raise

AttributeError: 'Series' object has no attribute 'foo'

?

pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-46-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: fr_FR.UTF-8

pandas: 0.16.0rc1-28-gd7d868f
nose: 1.3.1
Cython: 0.20.1post0
numpy: 1.8.2
scipy: 0.13.3
statsmodels: None
IPython: 1.2.1
sphinx: 1.2.2
patsy: None
dateutil: 2.4.1
pytz: 2013b
bottleneck: None
tables: 3.1.1
numexpr: 2.2.2
matplotlib: 1.3.1
openpyxl: None
xlrd: None
xlwt: 0.7.5
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.999
httplib2: 0.8
apiclient: None
sqlalchemy: 0.9.8
pymysql: None
psycopg2: None
@jreback
Copy link
Contributor

jreback commented Mar 19, 2015

it should. This is a very easy fix (look in __contains__ in tseries/base.py).

prob worth it to have some tests to confirm for all the datetimelike indexes as well. (Datetime,Timedelta,Period)

@jreback jreback added Bug API Design Timedelta Timedelta data type labels Mar 19, 2015
@jreback jreback added this to the 0.16.1 milestone Mar 19, 2015
@JonasAbernot
Copy link
Contributor Author

Indeed, it was. Is it worth a test ?

@jreback
Copy link
Contributor

jreback commented Mar 19, 2015

yes

@jreback
Copy link
Contributor

jreback commented Apr 28, 2015

closed by #9683

@jreback jreback closed this as completed Apr 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants