TypeError:ufunc'add'不包含签名匹配类型为(dtype('<U32'),dtype('<U32'))-> dtype('<U32')的循环

时间:2020-07-18 05:51:37

标签: python numpy-ufunc

def compile_stocks():
    list_of_reports = glob.glob(os.path.join(raw, '*.csv'))
    list_ = []
    for file in list_of_reports:
        print(file)
        if not os.path.isfile(file):
            continue
        df = pd.read_csv(file, low_memory=False, error_bad_lines=False)
        df['Name'] = os.path.basename(file).split('.')[0]
        # df = df.apply(str)
        print(df.head())
        list_.append(df)
    df = pd.concat(list_, sort=False)
    # df = df.sort_values(by='Date',ascending=True)
    print(df.head())
    return df

我正在尝试编译多个csv文件,但出现此错误: numpy.core._exceptions.UFuncTypeError:ufunc'add'不包含签名匹配类型为(dtype(' dtype('

0 个答案:

没有答案