小编Jki*_*nd9的帖子

将Excel数据加速到Pandas

I have a really simple bit of code, where I have a group of file names and I need to open each one and extract some data to later manipulate.

for file in unique_file_names[1:]:
        file_name = rootdir + "/" + str(file)
        test_time = time.clock()    
        try:
            wb_loop = load_workbook(file_name, read_only=True, data_only=True)
            ws_loop = wb_loop["SHEET1"]
            df = pd.DataFrame(ws_loop.values)
            print("Opening Workbook:         ", time.clock()-test_time)

            newarray = np.vstack((newarray, df.loc[4:43,:13].values))
            print("Data Manipulation:         ", time.clock()-test_time)
Run Code Online (Sandbox Code Playgroud)

So I've tried a few different modules to read in excel files, …

python excel performance python-3.x pandas

11
推荐指数
1
解决办法
351
查看次数

标签 统计

excel ×1

pandas ×1

performance ×1

python ×1

python-3.x ×1