How to multiply all the numeric values in the data frame by a constant without having to specify column names explicitly? Example:
In [13]: df = pd.DataFrame
This should work even over mixed types within columns but is likely slow over large dataframes.
def mul(x, y): try: return pd.to_numeric(x) * y except: return x df.applymap(lambda x: mul(x, 3))