You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This appears to have been fixed during some refactoring I did to the code supporting the join method recently. I added a test per above to verify that this works.
In some problems it is convenient to create an empty dataframe, and then append to it in a loop. The following code now breaks:
import pandas as ps
x = ps.DataFrame()
x.join(ps.DataFrame([3], index=[0], columns=['A']), how='outer')
x.join(ps.DataFrame([3], index=[0], columns=['A']))
Pandas 0.4.1
Pandas 0.4.3
Traceback (most recent call last):
File "<pyshell#1197>", line 1, in
x.join(ps.DataFrame([3], index=[0], columns=['A']), how='outer')
File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 2168, in join
return self._join_index(other, how, lsuffix, rsuffix)
File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 2193, in _join_index
merged_data = join_managers(thisdata, otherdata, axis=1, how=how)
File "C:\Python27\lib\site-packages\pandas\core\internals.py", line 958, in join_managers
lblocks = _maybe_upcast_blocks(left.blocks, lneed_masking)
File "C:\Python27\lib\site-packages\pandas\core\internals.py", line 1029, in _maybe_upcast_blocks
return _consolidate(new_blocks, newb.ref_items)
UnboundLocalError: local variable 'newb' referenced before assignment
The text was updated successfully, but these errors were encountered: