Python:尝试在DataFrame的切片副本上设置一个值

时间:2020-06-02 21:09:37

标签: python dataframe

我该怎么做才能得到Python的警告?为了避免错误,如果警告告诉了我...

        if DELfile.exists():
            print(DELfile)
            sectorDEL = pd.read_csv(DELfile, sep=';', header=0, float_precision='round_trip')
            if i == 1:
                sectorDELmax = sectorDEL
                i = i + 1
            else:
                k = 0
                for sensor in sectorDEL['SENSOR_NO']:
                    if sectorDEL['DAMAGE_EQUIVALENT_LOAD'][k] > sectorDELmax['DAMAGE_EQUIVALENT_LOAD'][k]:
                        sectorDELmax['DAMAGE_EQUIVALENT_LOAD'][k] = sectorDEL['DAMAGE_EQUIVALENT_LOAD'][k]
                    k = k + 1
        else:
            print('Could not find ' +str(DELfile))
            return None

0 个答案:

没有答案