标准时间格式:2012-12-21
时间转换函数:pandas.to_datatime()
# -*- coding: utf-8 -*-# 生成数据import pandas as pd data = { 'birth':['2011/12/01','2012/12/02','2012/12/03','2012/12/04','2012/12/05']}frame = pd.DataFrame(data)print(frame)""" birth0 2011/12/011 2012/12/022 2012/12/033 2012/12/044 2012/12/05"""# 标准时间格式frame['birth'] = pd.to_datetime(data['birth'])print(frame)""" birth0 2011-12-011 2012-12-022 2012-12-033 2012-12-044 2012-12-05"""