Examples
import numpy as np
import pandas as pd
df = pd.DataFrame([[2, 3.12], [4.356, 5.567]])
df
df.applymap(lambda x: len(str(x)))
You could square each number elementwise:
df.applymap(lambda x: x**2)
But it’s better to avoid applymap in that case.
df ** 2