A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/10618 below:

incorrect empty list handling in Cython outer_join_indexer · Issue #10618 · pandas-dev/pandas · GitHub

The low level Cython routine for outer_join_indexer uses the wrong size to handle the special case that the right array is empty (see: https://github.com/pydata/pandas/blob/master/pandas/src/generate_code.py#L2134). The fix is simple: if the right array is empty (nright == 0), it should of course loop and copy the left array (for i in range(nleft)).

Due to this bug, the merged index and both indexers are never written when the right array is empty:

In [91]: from pandas.algos import outer_join_indexer_float64

In [92]: outer_join_indexer_float64(array([1.,2.,3.]), array([]))
Out[92]: 
(array([  6.92981993e-310,   2.56210349e-316,   4.27255699e+180]),
 array([140261116804248, 140261116804248, 140260374492336]),
 array([140261116804232, 140261116804232,        50534992]))

Index.union already preempts this special case separately, so this bug will only affect a handful of people that interact directly with the Cython algos. If desired, I could prepare a PR tomorrow, though it might be overkill for such a small change.


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