python dataframe既有文字又有数字,列数很多,对数字进行处理,比如最后一列/100,或者所有数字列都/100.
import pandas as pd
d={
'name':['a','n','c','d','e','f'],
# 'Gender':['male','female','male','male','female','female'],
'age':[23,24,24,22,21,20],
'hight':[173,174,164,172,161,160],
'weight1':[53,74,44,62,71,60],
'weight2':[53,64,54,66,81,50]
}
df=pd.DataFrame(d)
df.set_index('name')
print(df)