Skip to content

Commit 485b68b

Browse files
committed
TST: DataFrame test coverage
1 parent 75026f2 commit 485b68b

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2444,7 +2444,7 @@ def _join_on(self, other, on, how, lsuffix, rsuffix):
24442444
if len(on) == 1:
24452445
join_key = self[on[0]].values
24462446
else:
2447-
join_key = zip(*[self[k] for k in on])
2447+
join_key = lib.fast_zip([self[k] for k in on])
24482448
join_key = common._asarray_tuplesafe(join_key,
24492449
dtype=np.object_)
24502450
elif isinstance(on, np.ndarray) and len(on) == len(self):

pandas/tests/test_frame.py

+5
Original file line numberDiff line numberDiff line change
@@ -2605,6 +2605,11 @@ def test_apply_raw(self):
26052605
assert_series_equal(result0, expected0)
26062606
assert_series_equal(result1, expected1)
26072607

2608+
# no reduction
2609+
result = self.frame.apply(lambda x: x * 2, raw=True)
2610+
expected = self.frame * 2
2611+
assert_frame_equal(result, expected)
2612+
26082613
def test_apply_axis1(self):
26092614
d = self.frame.index[0]
26102615
tapplied = self.frame.apply(np.mean, axis=1)

scripts/bench_join_multi.py

-24
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,3 @@ def _zip2(*args):
2828
'key2' : np.repeat(key2, 5)})
2929

3030
# data.join(to_join, on=['key1', 'key2'])
31-
32-
"""
33-
Cython function for list_to_object_array
34-
35-
def list_to_object_array(list obj):
36-
'''
37-
Convert list to object ndarray. Seriously can't believe I had to write this
38-
function
39-
'''
40-
cdef:
41-
Py_ssize_t i, n
42-
ndarray[object] arr
43-
44-
n = len(obj)
45-
arr = np.empty(n, dtype=object)
46-
47-
for i from 0 <= i < n:
48-
arr[i] = obj[i]
49-
50-
return arr
51-
"""
52-
53-
54-

0 commit comments

Comments
 (0)