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
The other answer specifies how to multiply only numeric columns. Here's how to update it:
df = pd.DataFrame({'col1': ['A','B','C'], 'col2':[1,2,3], 'col3': [30, 10,20]}) s = df.select_dtypes(include=[np.number])*3 df[s.columns] = s print (df) col1 col2 col3 0 A 3 90 1 B 6 30 2 C 9 60