【发布时间】:2020-07-25 20:27:31
【问题描述】:
您好,我正在使用 python 进行数据分析项目,我有一个大约 2.8GB 的 XML 文件,该文件太大而无法打开。我下载了帮助我打开文件的 EmEditor。问题是当我尝试像这样在 python google colaboratory 中加载文件时:
import xml.etree.ElementTree as ET
tree = ET.parse('dataset.xml') //dataset.xml is the name of my file
root = tree.getroot()
我得到的结果是 No such file or directory: 'dataset.xml' exists 。我的桌面上有我的 dataset.xml 文件,它可以使用 EmEditor 打开,这让我认为它可以通过 EmEditor 进行编辑和加载,但我不知道。感谢您帮助我在 python 中加载数据 谷歌实验室。
【问题讨论】:
-
Shentos 逐行尝试。这是一个示例:stackoverflow.com/questions/61228553/…