asset_writer.py 文件源码

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

项目:catalyst 作者: enigmampc 项目源码 文件源码
def _dt_to_epoch_ns(dt_series):
    """Convert a timeseries into an Int64Index of nanoseconds since the epoch.

    Parameters
    ----------
    dt_series : pd.Series
        The timeseries to convert.

    Returns
    -------
    idx : pd.Int64Index
        The index converted to nanoseconds since the epoch.
    """
    index = pd.to_datetime(dt_series.values)
    if index.tzinfo is None:
        index = index.tz_localize('UTC')
    else:
        index = index.tz_convert('UTC')
    return index.view(np.int64)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号