kepler_util.py 文件源码

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

项目:scikit-dataaccess 作者: MITHaystack 项目源码 文件源码
def normalize(in_data, column='PDCSAP_FLUX', group_column='QUARTER'):
    '''
    This function normalizes PDCSAP_FLUX data by quarter by dividing the flux by the median for the quarter

    @param in_data: Data to be normalized
    @param column: Name of column to be normalized
    @param group_column: Name of column used to group data
    '''

    if group_column != None:
        group_list = list(set(in_data[group_column]))

        group_list.sort()

        for group in group_list:
            index = in_data[group_column] == group
            in_data.loc[index, column] = in_data.loc[index,column] / np.nanmedian(in_data.loc[index,column])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号