Skip to content

Odd merge error #1307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wesm opened this issue May 24, 2012 · 0 comments
Closed

Odd merge error #1307

wesm opened this issue May 24, 2012 · 0 comments
Labels
Milestone

Comments

@wesm
Copy link
Member

wesm commented May 24, 2012

In [6]: df1
Out[6]: 
                     x
1970-01-16 08:09:36  a

In [7]: df2
Out[7]: 
                     y
1970-01-16 08:09:36  b
1970-01-16 08:09:36  c

In [8]: merge(df1, df2)
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
/home/wesm/code/pandas/<ipython-input-8-90d5dd612b4d> in <module>()
----> 1 merge(df1, df2)

/home/wesm/code/pandas/pandas/tools/merge.pyc in merge(left, right, how, on, left_on, right_on, left_index, right_index, sort, suffixes, copy)
     30                          right_index=right_index, sort=sort, suffixes=suffixes,
     31                          copy=copy)
---> 32     return op.get_result()
     33 if __debug__: merge.__doc__ = _merge_doc % '\nleft : DataFrame'
     34 

/home/wesm/code/pandas/pandas/tools/merge.pyc in get_result(self)
    174 
    175     def get_result(self):
--> 176         join_index, left_indexer, right_indexer = self._get_join_info()
    177 
    178         # this is a bit kludgy

/home/wesm/code/pandas/pandas/tools/merge.pyc in _get_join_info(self)
    247         else:
    248             # max groups = largest possible number of distinct groups
--> 249             left_key, right_key, max_groups = self._get_group_keys()
    250 
    251             join_func = _join_functions[self.how]

/home/wesm/code/pandas/pandas/tools/merge.pyc in _get_group_keys(self)
    411             group_sizes.append(count)
    412 
--> 413         left_group_key = get_group_index(left_labels, group_sizes)
    414         right_group_key = get_group_index(right_labels, group_sizes)
    415 

/home/wesm/code/pandas/pandas/core/groupby.pyc in get_group_index(label_list, shape)
   1921         return label_list[0]
   1922 
-> 1923     n = len(label_list[0])
   1924     group_index = np.zeros(n, dtype=np.int64)
   1925     mask = np.zeros(n, dtype=bool)

IndexError: list index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant