xref #10972 - but not the same issue. I've got a fix for this + #12737 coming.
Code Sample, a copy-pastable example if possibleIn [20]: df = pd.DataFrame({'grouping':[np.nan,1,1,3], 'v':[1.1, 2.1, 3.1, 4.5], 'd':pd.date_range('2014-1-1','2014-1-4')}) In [21]: df.groupby('grouping')['d'].transform('first') --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-21-cb1ed73aabc3> in <module>() ----> 1 df.groupby('grouping')['d'].transform('first') C:\Users\Chris\Anaconda\lib\site-packages\pandas\core\groupby.pyc in transform(self, func, *args, **kwargs) 2738 # cythonized aggregation and merge 2739 return self._transform_fast( -> 2740 lambda: getattr(self, func)(*args, **kwargs)) 2741 2742 # reg transform C:\Users\Chris\Anaconda\lib\site-packages\pandas\core\groupby.pyc in _transform_fast(self, func) 2781 out = func().values[ids] 2782 if not mask.all(): -> 2783 out = np.where(mask, out, np.nan) 2784 2785 obs = np.zeros(ngroup, dtype='bool') TypeError: invalid type promotion
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4