![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
panda
数据分析使用
坎布里奇
从业互联网多年的小白
展开
-
pandas 日期处理
pandas 日期处理 - 幕布pandas 日期处理列表:pd.Timestamp()pd.Timedelta()pd.datetime( )pd.Period()pd.to_timestamp()datetime.strftime()pd.to_datetime( )pd.to_period()pd.Timestamp()作用:转为时间戳列子:1. 2.pd.Timedelta()作用: 实现datetime的加减例子:pd.Period()作用:例子:1.2.修改频率,以月为单位3...原创 2020-10-14 21:23:12 · 290 阅读 · 0 评论 -
Python 处理日期格式
Python 处理日期格式 - 幕布Python 处理日期格式一、需求:获取的数据,给的时间格式为时间戳,想要使用df.to_sql("m",con=engine,index=False,if_exists='append')直接存入数据库,不想一一处理。二、原始数据显示:三、解决方法:使用pd.to_datetime()方法;df['time'] = pd.to_datetime(df['time']/1000, unit='s', origin=pd.Timestamp('1970-...原创 2020-10-14 21:21:46 · 480 阅读 · 0 评论