Skip to content Skip to sidebar Skip to footer

Error When Trying To Multiply A Variable?

I'm trying to multiply a variable to output a weighted value as follows: import numpy as np import pandas as pd data_2017_18.income1_weight = data_2017_18.income1 * data_2017_18.s

Solution 1:

Try Series.astype:

data_2017_18.income1_weight = data_2017_18.income1.astype(float) * data_2017_18.survey_weight

Post a Comment for "Error When Trying To Multiply A Variable?"