【发布时间】:2018-12-13 14:38:26
【问题描述】:
我需要获取 DataFrame 中列的每个元素的日志值。我还想将结果列添加到前一个数据框中。
这是我的数据框
df1=pd.read_csv('doctors.csv',encoding='latin-1')
这些是列
Index(['PatientID', 'Pregnancies', 'PlasmaGlucose', 'DiastolicBloodPressure',
'TricepsThickness', 'SerumInsulin', 'BMI', 'DiabetesPedigree', 'Age',
'Diabetic', 'Physician'],
dtype='object')
我想为“年龄”列形成一个新的对数列。
【问题讨论】:
-
可以添加数据样本吗?
标签: pandas numpy dataframe logging machine-learning