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
BUG: check if a collections.Sequence on printing #3240
Comments
yep....also need to accept this in the constructors (as well as output-formatters) maybe should have a function to basically do the test |
the opt-in register() mechanism of the ABCs is pretty useful, just need |
actually this is a bit more complicated, the problem is that a |
what?! how is Timestamp a sequence? In [39]: t=Timestamp("2000-1-1")
In [40]: t[0]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-40-d0a24a012877> in <module>()
----> 1 t[0]
TypeError: 'Timestamp' object does not support indexing
In [41]: list(t)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-41-f57fd3c9bd0b> in <module>()
----> 1 list(t)
TypeError: 'Timestamp' object is not iterable
In [42]: import collections
In [43]: isinstance(t,collections.Sequence)
Out[43]: False |
sorry...meant that it isn't a scalar (though we treat it like one)
|
@jreback maybe this is silly, but why is the way that it prints actually wrong? Is there another example where this would matter? [clearly, I'm going through earlier bug reports] |
no the issue here is this is you have a list of lists then the DataFrame constructor works fine but if its a list-of-sequencers that are not lists but act like lists (eg collections.Sequence) then it doesn't work this used to work when we used np.asarray but for various reasons the conversions are now a bit more 'manual' so this is actually pretty easy to just accept a collections.Sequence in the constructors |
Closed due to age and ambiguity. If there is a reproducible example for issue feel free to reopen |
http://stackoverflow.com/questions/15769706/converting-a-list-in-a-dict-to-a-series/15770083?noredirect=1#comment22416395_15770083
The text was updated successfully, but these errors were encountered: