We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7669d0 commit 83ab0caCopy full SHA for 83ab0ca
pandas/core/frame.py
@@ -4124,6 +4124,22 @@ def applymap(self, func):
4124
func : function
4125
Python function, returns a single value from a single value
4126
4127
+ Examples
4128
+ --------
4129
+
4130
+ >>> df = pd.DataFrame(np.random.randn(3, 3))
4131
+ >>> df
4132
+ 0 1 2
4133
+ 0 -0.029638 1.081563 1.280300
4134
+ 1 0.647747 0.831136 -1.549481
4135
+ 2 0.513416 -0.884417 0.195343
4136
+ >>> df = df.applymap(lambda x: '%.2f' % x)
4137
4138
4139
+ 0 -0.03 1.08 1.28
4140
+ 1 0.65 0.83 -1.55
4141
+ 2 0.51 -0.88 0.20
4142
4143
Returns
4144
-------
4145
applied : DataFrame
0 commit comments