<bdo id='JUbhf'></bdo><ul id='JUbhf'></ul>
<tfoot id='JUbhf'></tfoot>

    <legend id='JUbhf'><style id='JUbhf'><dir id='JUbhf'><q id='JUbhf'></q></dir></style></legend>
  1. <small id='JUbhf'></small><noframes id='JUbhf'>

    <i id='JUbhf'><tr id='JUbhf'><dt id='JUbhf'><q id='JUbhf'><span id='JUbhf'><b id='JUbhf'><form id='JUbhf'><ins id='JUbhf'></ins><ul id='JUbhf'></ul><sub id='JUbhf'></sub></form><legend id='JUbhf'></legend><bdo id='JUbhf'><pre id='JUbhf'><center id='JUbhf'></center></pre></bdo></b><th id='JUbhf'></th></span></q></dt></tr></i><div id='JUbhf'><tfoot id='JUbhf'></tfoot><dl id='JUbhf'><fieldset id='JUbhf'></fieldset></dl></div>

      用Python pandas 阅读SharePoint EXCEL文件

      Read sharepoint excel file with python pandas(用Python pandas 阅读SharePoint EXCEL文件)

          <tbody id='FedHW'></tbody>
          <bdo id='FedHW'></bdo><ul id='FedHW'></ul>
            1. <small id='FedHW'></small><noframes id='FedHW'>

              <i id='FedHW'><tr id='FedHW'><dt id='FedHW'><q id='FedHW'><span id='FedHW'><b id='FedHW'><form id='FedHW'><ins id='FedHW'></ins><ul id='FedHW'></ul><sub id='FedHW'></sub></form><legend id='FedHW'></legend><bdo id='FedHW'><pre id='FedHW'><center id='FedHW'></center></pre></bdo></b><th id='FedHW'></th></span></q></dt></tr></i><div id='FedHW'><tfoot id='FedHW'></tfoot><dl id='FedHW'><fieldset id='FedHW'></fieldset></dl></div>
                <tfoot id='FedHW'></tfoot>
              • <legend id='FedHW'><style id='FedHW'><dir id='FedHW'><q id='FedHW'></q></dir></style></legend>
                本文介绍了用Python pandas 阅读SharePoint EXCEL文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试使用How to read SharePoint Online (Office365) Excel files into Python specifically pandas with Work or School Account?答案中的此代码,但a获取XLRDError:不支持的格式,或损坏的文件:预期的BOF记录;找到b‘ <;!Doct‘。我想问题出在我放置道路的方式上。有没有人知道如何获得这种Sharepoint路径,如下例所示?我得到的路径看起来更像是这样的";https://company.sharepoint.com/sites/site/Shared%20Documents/Forms/AllItems.aspx";

                (&Q;
                #import all the libraries
                from office365.runtime.auth.authentication_context import AuthenticationContext
                from office365.sharepoint.client_context import ClientContext
                from office365.sharepoint.files.file import File 
                import io
                import pandas as pd
                
                #target url taken from sharepoint and credentials
                url = 'https://company.sharepoint.com/Shared%20Documents/Folder%20Number1/Folder%20Number2/Folder3/Folder%20Number4/Target_Excel_File_v4.xlsx?cid=_Random_letters_and_numbers-21dbf74c'
                username = 'Dumby_account@company.com'
                password = 'Password!'
                
                ctx_auth = AuthenticationContext(url)
                if ctx_auth.acquire_token_for_user(username, password):
                  ctx = ClientContext(url, ctx_auth)
                  web = ctx.web
                  ctx.load(web)
                  ctx.execute_query()
                  print("Authentication successful")
                
                response = File.open_binary(ctx, url)
                
                #save data to BytesIO stream
                bytes_file_obj = io.BytesIO()
                bytes_file_obj.write(response.content)
                bytes_file_obj.seek(0) #set file object to start
                
                #read excel file and each sheet into pandas dataframe 
                df = pd.read_excel(bytes_file_obj, sheetname = None)
                

                推荐答案

                我是通过在桌面中打开文件并转到文件&>信息&>复制路径来完成此操作的。此路径应该可以工作。

                这篇关于用Python pandas 阅读SharePoint EXCEL文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)
                Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)
                Is there a way of group by month in Pandas starting at specific day number?( pandas 有从特定日期开始的按月分组的方式吗?)
                Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)
                Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)
                Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)
                <legend id='DvXJF'><style id='DvXJF'><dir id='DvXJF'><q id='DvXJF'></q></dir></style></legend>

                <i id='DvXJF'><tr id='DvXJF'><dt id='DvXJF'><q id='DvXJF'><span id='DvXJF'><b id='DvXJF'><form id='DvXJF'><ins id='DvXJF'></ins><ul id='DvXJF'></ul><sub id='DvXJF'></sub></form><legend id='DvXJF'></legend><bdo id='DvXJF'><pre id='DvXJF'><center id='DvXJF'></center></pre></bdo></b><th id='DvXJF'></th></span></q></dt></tr></i><div id='DvXJF'><tfoot id='DvXJF'></tfoot><dl id='DvXJF'><fieldset id='DvXJF'></fieldset></dl></div>
              • <tfoot id='DvXJF'></tfoot>
                1. <small id='DvXJF'></small><noframes id='DvXJF'>

                    <bdo id='DvXJF'></bdo><ul id='DvXJF'></ul>

                          <tbody id='DvXJF'></tbody>