2014-11-12 1 views
0
In [26]: xyz = temp_val_ns.join(temp_ref_ns, how='outer') 

    Traceback (most recent call last): 

    File "<ipython-input-26-e10ed4b1946b>", line 1, in <module> 
    xyz = temp_val_ns.join(temp_ref_ns, how='outer') 

    File "C:\Anaconda\lib\site-packages\pandas\core\frame.py", line 3867, in join 
    rsuffix=rsuffix, sort=sort) 

    File "C:\Anaconda\lib\site-packages\pandas\core\frame.py", line 3881, in _join_compat 
    suffixes=(lsuffix, rsuffix), sort=sort) 

    File "C:\Anaconda\lib\site-packages\pandas\tools\merge.py", line 39, in merge 
    return op.get_result() 

    File "C:\Anaconda\lib\site-packages\pandas\tools\merge.py", line 187, in get_result 
    join_index, left_indexer, right_indexer = self._get_join_info() 

    File "C:\Anaconda\lib\site-packages\pandas\tools\merge.py", line 260, in _get_join_info 
    left_ax.join(right_ax, how=self.how, return_indexers=True) 

    File "C:\Anaconda\lib\site-packages\pandas\core\index.py", line 1729, in join 
    elif self.is_monotonic and other.is_monotonic: 

    File "C:\Anaconda\lib\site-packages\pandas\core\index.py", line 577, in is_monotonic 
    return self._engine.is_monotonic_increasing 

AttributeError: 'pandas.index.Int64Engine' object has no attribute 'is_monotonic_increasing' 

나는 0.15에서 아무런 문제가 없었으므로 this change과 관련이있을 수 있습니다. 비슷한 문제가있는 사람과 해결 방법이 있는지 궁금해. 미리 감사드립니다.팬더에서 외부 조인을 사용하는 AttributeError 0.15.1

EDIT : 재현 가능한 예를 추가하십시오.

aaa = {'bbot_sampler_ref': {1413180063086001221: True, 
1413180063086915835: True, 
1413180063086998237: True, 
1413180063087746824: True, 
1413180063089530483: True}, 
'bw_ref': {1413180063086001221: 128.04550264550264, 
1413180063086915835: 128.04553191489362, 
1413180063086998237: 128.04559139784948, 
1413180063087746824: 128.04556756756756, 
1413180063089530483: 128.04492822966506}} 
temp_ref_ns = pd.DataFrame(aaa) 
bbb = { 
'agg': {1413180063080171210: 1, 
    1413180063080280537: 1, 
    1413180063080365279: 1, 
    1413180063080440876: 1, 
    1413180063080514973: 1}, 
'last_trade': {1413180063080171210: 150.75, 
    1413180063080280537: 150.75, 
    1413180063080365279: 150.75, 
    1413180063080440876: 150.75, 
    1413180063080514973: 150.75}, 
'mid': {1413180063080171210: 150.745, 
    1413180063080280537: 150.745, 
    1413180063080365279: 150.745, 
    1413180063080440876: 150.745, 
    1413180063080514973: 150.745}, 
'pcap_seq': {1413180063080171210: 17613, 
    1413180063080280537: 17615, 
    1413180063080365279: 17617, 
    1413180063080440876: 17619, 
    1413180063080514973: 17621}, 
'timestamp': {1413180063080171210: 1413180063080171210, 
    1413180063080280537: 1413180063080280537, 
    1413180063080365279: 1413180063080365279, 
    1413180063080440876: 1413180063080440876, 
    1413180063080514973: 1413180063080514973}} 
temp_val_ns = pd.DataFrame(bbb) 

그런 다음이 위의 오류와 함께 실패합니다

xyz = temp_val_ns.join(temp_ref_ns, how='outer') 
+0

작은 재현 가능한 예를 보여줄 수 있습니까? (버그보고에 대해서는 https://github.com/pydata/pandas/issues에서 더 잘보고하십시오) – joris

답변

0

은 0.15.1에서 나를 위해 일했다. 수신 한 오류는 소스를 업데이트했으나 is_monotonic_increasing이라는 함수가 0.15.1에서 새로 추가되었으므로 (수동으로 코드를 설치 한 경우) 다시 컴파일하지 않았기 때문에 발생할 수 있습니다.

In [11]: temp_ref_ns 
Out[11]: 
        bbot_sampler_ref  bw_ref 
1413180063086001221    True 128.045503 
1413180063086915835    True 128.045532 
1413180063086998237    True 128.045591 
1413180063087746824    True 128.045568 
1413180063089530483    True 128.044928 

In [12]: temp_val_ns 
Out[12]: 
        agg last_trade  mid pcap_seq   timestamp 
1413180063080171210 1  150.75 150.745  17613 1413180063080171210 
1413180063080280537 1  150.75 150.745  17615 1413180063080280537 
1413180063080365279 1  150.75 150.745  17617 1413180063080365279 
1413180063080440876 1  150.75 150.745  17619 1413180063080440876 
1413180063080514973 1  150.75 150.745  17621 1413180063080514973 

In [13]: temp_val_ns.join(temp_ref_ns, how='outer') 
Out[13]: 
        agg last_trade  mid pcap_seq  timestamp bbot_sampler_ref  bw_ref 
1413180063080171210 1  150.75 150.745  17613 1.413180e+18    NaN   NaN 
1413180063080280537 1  150.75 150.745  17615 1.413180e+18    NaN   NaN 
1413180063080365279 1  150.75 150.745  17617 1.413180e+18    NaN   NaN 
1413180063080440876 1  150.75 150.745  17619 1.413180e+18    NaN   NaN 
1413180063080514973 1  150.75 150.745  17621 1.413180e+18    NaN   NaN 
1413180063086001221 NaN   NaN  NaN  NaN   NaN    True 128.045503 
1413180063086915835 NaN   NaN  NaN  NaN   NaN    True 128.045532 
1413180063086998237 NaN   NaN  NaN  NaN   NaN    True 128.045591 
1413180063087746824 NaN   NaN  NaN  NaN   NaN    True 128.045568 
1413180063089530483 NaN   NaN  NaN  NaN   NaN    True 128.044928 
+0

당신이 옳을 가능성이 큽니다. 나는 아나콘다를 사용하고 있는데 나는 "conda update pandas"를하여 0.15.1을 얻었다. 이 문제에 부딪친 후 나는 그것을 해결하지 못한 팬더를 제거하고 다시 설치하려고했습니다. 어떤 제안? – zerovector

+0

권한이 없거나 설치에 실패했습니다. – Jeff

+1

https://github.com/pydata/pandas/issues/8804 – zerovector

관련 문제