ulysses.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:heliopy 作者: heliopython 项目源码 文件源码
def _convert_ulysses_time(data):
    """Method to convert timestamps to datetimes"""
    data.loc[data['year'] > 50, 'year'] += 1900
    data.loc[data['year'] < 50, 'year'] += 2000

    data['Time'] = pd.to_datetime(data['year'].astype(str) + ':' +
                                  data['doy'].astype(str),
                                  format='%Y:%j')
    data['Time'] += (pd.to_timedelta(data['hour'], unit='h') +
                     pd.to_timedelta(data['minute'], unit='m') +
                     pd.to_timedelta(data['second'], unit='s'))
    data = data.drop(['year', 'doy', 'hour', 'minute', 'second'],
                     axis=1)
    return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号