如何将云file upload到Python

如果文件在本地驱动器中,我使用上传excel文件到pandasdataframe pd.ExcelFile如果我在Google云端硬盘或Microsoft One Drive中有Excel文件并且想要远程连接,我该怎么做?

你可以在StringIO对象上使用read_csv():

from StringIO import StringIO # moved to io in python3. import requests r = requests.get('Your google drive link') data = r.content df = pd.read_csv(StringIO(data))