File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ pandas 0.6.1
42
42
- Implement new SparseList and SparseArray data structures. SparseSeries now
43
43
derives from SparseArray (GH #463)
44
44
- max_columns / max_rows options in set_printoptions (PR #453)
45
+ - Implement Series.rank and DataFrame.rank, fast versions of
46
+ scipy.stats.rankdata (GH #428)
45
47
46
48
**Improvements to existing features **
47
49
Original file line number Diff line number Diff line change @@ -2410,17 +2410,7 @@ def applymap(self, func):
2410
2410
-------
2411
2411
applied : DataFrame
2412
2412
"""
2413
- npfunc = np .frompyfunc (func , 1 , 1 )
2414
-
2415
- def f (x ):
2416
- result = npfunc (x )
2417
- try :
2418
- result = result .astype (x .dtype )
2419
- except Exception :
2420
- pass
2421
- return result
2422
-
2423
- return self .apply (f )
2413
+ return self .apply (lambda x : lib .map_infer (x , func ))
2424
2414
2425
2415
#----------------------------------------------------------------------
2426
2416
# Merging / joining methods
Original file line number Diff line number Diff line change @@ -2923,6 +2923,10 @@ def test_applymap(self):
2923
2923
assert_frame_equal (applied , self .frame * 2 )
2924
2924
result = self .frame .applymap (type )
2925
2925
2926
+ # GH #465, function returning tuples
2927
+ result = self .frame .applymap (lambda x : (x , x ))
2928
+ self .assert_ (isinstance (result ['A' ][0 ], tuple ))
2929
+
2926
2930
def test_filter (self ):
2927
2931
# items
2928
2932
You can’t perform that action at this time.
0 commit comments