Skip to content

DataFrame repr fails for nonunique columns #1700

Closed
@changhiskhan

Description

@changhiskhan
In [14]: df.columns
Out[14]: 
Index([Ticker, Company Name, Position, $ Value, Position, $ Value,
       % of Equity, Current Price $, Closing Price $, Current Price,
       Closing Price, Px Change, Daily P&L $, Daily Perf., Total P/L 2008], dtype=object)

In [15]: repr(df)
\---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-15-d04570933a95> in <module>()
----> 1 repr(df)

/Users/changshe/code/pandas/pandas/core/frame.pyc in __repr__(self)
    579         buf = StringIO()
    580         if self._need_info_repr_():
--> 581             self.info(buf=buf, verbose=self._verbose_info)
    582         else:
    583             self.to_string(buf=buf)

/Users/changshe/code/pandas/pandas/core/frame.pyc in info(self, verbose, buf)
   1310             lines.append(self.columns.summary(name='Columns'))
   1311 
-> 1312         counts = self.get_dtype_counts()
   1313         dtypes = ['%s(%d)' % k for k in sorted(counts.iteritems())]
   1314         lines.append('dtypes: %s' % ', '.join(dtypes))

/Users/changshe/code/pandas/pandas/core/frame.pyc in get_dtype_counts(self)
   1342         for _, series in self.iterkv():
   1343             # endianness can cause dtypes to look different
-> 1344             dtype_str = str(series.dtype)
   1345             if dtype_str in counts:
   1346                 counts[dtype_str] += 1

/Users/changshe/code/pandas/pandas/core/frame.pyc in __getattr__(self, name)
   1697             return self[name]
   1698         raise AttributeError("'%s' object has no attribute '%s'" %
-> 1699                              (type(self).__name__, name))
   1700 
   1701     def __setattr__(self, name, value):

AttributeError: 'DataFrame' object has no attribute 'dtype'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions