Skip to content

BUG: string output on PeriodIndex fails #2549

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
jreback opened this issue Dec 16, 2012 · 0 comments
Closed

BUG: string output on PeriodIndex fails #2549

jreback opened this issue Dec 16, 2012 · 0 comments
Labels
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Dec 16, 2012

used to work in 0.9.1.

this is on current master

In [1]: import numpy as np

In [2]: import pandas as pd

In [3]: index = pd.PeriodIndex(['2011-1', '2011-2', '2011-3'], freq='M')

In [4]: frame = pd.DataFrame(np.random.randn(3,4),index=index)

In [5]: frame.to_string()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-b6219037419a> in <module>()
----> 1 frame.to_string()

/mnt/home/jreback/pandas/pandas/core/frame.pyc in to_string(self, buf, columns, col_space, colSpace, header, index, na_rep, formatters, float_format, sparsify, nanRep, index_names, justify, force_unicode, line_width)
   1501                                            header=header, index=index,
   1502                                            line_width=line_width)
-> 1503         formatter.to_string()
   1504 
   1505         if buf is None:

/mnt/home/jreback/pandas/pandas/core/format.pyc in to_string(self, force_unicode)
    295             text = info_line
    296         else:
--> 297             strcols = self._to_str_columns()
    298             if self.line_width is None:
    299                 text = adjoin(1, *strcols)

/mnt/home/jreback/pandas/pandas/core/format.pyc in _to_str_columns(self)
    240 
    241         # may include levels names also
--> 242         str_index = self._get_formatted_index()
    243         str_columns = self._get_formatted_column_labels()
    244 

/mnt/home/jreback/pandas/pandas/core/format.pyc in _get_formatted_index(self)
    444                                      formatter=fmt)
    445         else:
--> 446             fmt_index = [index.format(name=show_index_names, formatter=fmt)]
    447 
    448         adjoined = adjoin(1, *fmt_index).split('\n')

TypeError: format() got an unexpected keyword argument 'formatter'

@wesm wesm closed this as completed in 2a56d41 Dec 17, 2012
yarikoptic added a commit to neurodebian/pandas that referenced this issue Dec 20, 2012
Version 0.10.0 final

* tag 'v0.10.0': (27 commits)
  RLS: Version 0.10.0 final
  DOC: rolling window examples pandas-dev#2477
  DOC: wide frame repr examples in dsintro pandas-dev#2477
  DOC: add some licenses, remove b1 qualifier
  BUG: don't fail in PeriodIndex.format when passing formatter. close pandas-dev#2549
  BUG: more memory usage fixes
  BUG: ordering in returned data on an index axis if had a selection filter      e.g. had > 61 fields that were specified in a Term (weird but true)
  BUG: allow perf_HEAD to run off travis
  BLD:  add pytables as dep in VBENCH travis build
  ENH: perf_HEAD cleanups and enhancements
  CLN: modify test_perf to allow import as a module
  CLN: remove redundant assignment
  CLN: remove argument and deprecation warning from internal function
  BUG: remove pdb
  BUG: fix panel bin-grouping aggregation with custom functions. close pandas-dev#2537
  ENH: read_* function header inference. make backwards compatible again with 0.9.x. close pandas-dev#2539
  BUG: handle bytes in regular expression parsing for python 3
  Fix compilation on MSVC, signbit not in math.h
  TST: unit test for groupby apply
  BUG: copy=False on reindex of non_index_axis BUG: incorrect permuting of data orientation on ndim with non-default axe      (e.g. store data in order ['major_axis','labels,'minor_axis']) TST: much more robust tests on ndim indexables different from default
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants