We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a050a33 + 83ab0ca commit 2ac4015Copy full SHA for 2ac4015
pandas/core/frame.py
@@ -4138,6 +4138,22 @@ def applymap(self, func):
4138
func : function
4139
Python function, returns a single value from a single value
4140
4141
+ Examples
4142
+ --------
4143
+
4144
+ >>> df = pd.DataFrame(np.random.randn(3, 3))
4145
+ >>> df
4146
+ 0 1 2
4147
+ 0 -0.029638 1.081563 1.280300
4148
+ 1 0.647747 0.831136 -1.549481
4149
+ 2 0.513416 -0.884417 0.195343
4150
+ >>> df = df.applymap(lambda x: '%.2f' % x)
4151
4152
4153
+ 0 -0.03 1.08 1.28
4154
+ 1 0.65 0.83 -1.55
4155
+ 2 0.51 -0.88 0.20
4156
4157
Returns
4158
-------
4159
applied : DataFrame
0 commit comments