Skip to content

repr of Periods in a Series is broken #10971

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

Closed
jorisvandenbossche opened this issue Sep 2, 2015 · 1 comment
Closed

repr of Periods in a Series is broken #10971

jorisvandenbossche opened this issue Sep 2, 2015 · 1 comment
Labels
Output-Formatting __repr__ of pandas objects, to_string
Milestone

Comments

@jorisvandenbossche
Copy link
Member

With latest master:

In [1]: from pandas import *

In [7]: p = period_range('2013',periods=10)

In [8]: p
Out[8]:
PeriodIndex(['2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04',
             '2013-01-05', '2013-01-06', '2013-01-07', '2013-01-08',
             '2013-01-09', '2013-01-10'],
            dtype='int64', freq='D')

In [10]: Series(p)
Out[10]: -----------------------------------------------------------------------
----
AttributeError                            Traceback (most recent call last)
C:\Anaconda\envs\devel\lib\site-packages\IPython\core\formatters.pyc in __call__
(self, obj)
    693                 type_pprinters=self.type_printers,
    694                 deferred_pprinters=self.deferred_printers)
--> 695             printer.pretty(obj)
    696             printer.flush()
    697             return stream.getvalue()
...

c:\users\vdbosscj\scipy\pandas-joris\pandas\core\format.pyc in _format_strings(s
elf)
   2107
   2108     def _format_strings(self):
-> 2109         values = np.array(self.values.to_native_types(), dtype=object)
   2110         formatter = self.formatter or (lambda x: '%s' % x)
   2111         fmt_values = [formatter(x) for x in values]

AttributeError: 'numpy.ndarray' object has no attribute 'to_native_types'

cc @sinhrks (I was trying to fix the stacklevel for the FutureWarnings, but saw this error, possibly related to your recent Period work?)

@jorisvandenbossche jorisvandenbossche added the Output-Formatting __repr__ of pandas objects, to_string label Sep 2, 2015
@jorisvandenbossche jorisvandenbossche added this to the 0.17.0 milestone Sep 2, 2015
@sinhrks
Copy link
Member

sinhrks commented Sep 2, 2015

Thanks, will check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

No branches or pull requests

2 participants