Skip to content

Commit 0c8675f

Browse files
committed
TST: Add test for apply cast types GH#9506
Signed-off-by: Liang Yan <[email protected]>
1 parent c65c8dd commit 0c8675f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/tests/apply/test_series_apply.py

+12
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,18 @@ def test_apply_empty_integer_series_with_datetime_index(by_row):
271271
tm.assert_series_equal(result, s)
272272

273273

274+
def test_apply_dataframe_iloc():
275+
uintDF = DataFrame(np.uint64([1, 2, 3, 4, 5]), columns=["Numbers"])
276+
indexDF = DataFrame([2, 3, 2, 1, 2], columns=["Indices"])
277+
278+
def retrieve(targetRow, targetDF):
279+
val = targetDF["Numbers"].iloc[targetRow]
280+
return val
281+
282+
resultDF = indexDF["Indices"].apply(retrieve, args=(uintDF,))
283+
assert resultDF.dtypes == "uint64"
284+
285+
274286
def test_transform(string_series, by_row):
275287
# transforming functions
276288

0 commit comments

Comments
 (0)