multiply column of dataframe by number
#Multiply the values of column_name by 100
df.column_name.mul(100)
multiply column of dataframe by number
#Multiply the values of column_name by 100
df.column_name.mul(100)
python multiply one column of array by a value
import numpy as np
# Let a be some 2d array; here we just use dummy data
# to illustrate the method
a = np.ones((10,5))
# Multiply just the 2nd column by 5.2 in-place
a[:,1] *= 5.2
# Now get the cumulative sum of just that column
csum = np.cumsum(a[:,1])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us