Quantipy / quantipy

Python for people data
MIT License
66 stars 14 forks source link

bug in paint_structure for delimited sets #1161

Closed nitsrek closed 5 years ago

nitsrek commented 6 years ago
c:\users\kmue\desktop\quantipy\quantipy\sandbox\sandbox.py in _paint_structure(self, text_key, sep, na_rep)
   2976                     }
   2977                     series = self.structure[column]
-> 2978                     series = (series.str.split(';')
   2979                                     .apply(pd.Series, 1)
   2980                                     .stack(dropna=False)

C:\ProgramData\Anaconda2\lib\site-packages\pandas\core\generic.pyc in __getattr__(self, name)
   2738         if (name in self._internal_names_set or name in self._metadata or
   2739                 name in self._accessors):
-> 2740             return object.__getattribute__(self, name)
   2741         else:
   2742             if name in self._info_axis:

C:\ProgramData\Anaconda2\lib\site-packages\pandas\core\base.pyc in __get__(self, instance, owner)
    239             # this ensures that Series.str.<method> is well defined
    240             return self.accessor_cls
--> 241         return self.construct_accessor(instance)
    242 
    243     def __set__(self, instance, value):

C:\ProgramData\Anaconda2\lib\site-packages\pandas\core\strings.pyc in _make_str_accessor(self)
   1839             # (instead of test for object dtype), but that isn't practical for
   1840             # performance reasons until we have a str dtype (GH 9343)
-> 1841             raise AttributeError("Can only use .str accessor with string "
   1842                                  "values, which use np.object_ dtype in "
   1843                                  "pandas")

AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas
nitsrek commented 6 years ago

done and merged #1162