map 可用在Series上,格式:Series.map(dic) dic为自定义的映射字典,例:dic={1:2,2:4} 如果用在DataFrame上,需指定某一列,如df['a'].map(dic)。如果df只有一列,也需要指定列。