Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有许多选项卡和大量数据的 Excel。我用 Python 替换了 vba 代码,它运行良好,但是读取 excel 数据需要很长时间。我可以做些什么来提高性能吗?谢谢。
一个明显的加速方法是最小化从 Python 到 Excel 的跨应用程序调用。一个例子(来自文档):它总是Range('A1').value = [[1,2],[3,4]]比做Range('A1').value = [1, 2]更有效率Range('A2').value = [3, 4]
Range('A1').value = [[1,2],[3,4]]
Range('A1').value = [1, 2]
Range('A2').value = [3, 4]