久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='nxD8c'></tfoot>
    1. <legend id='nxD8c'><style id='nxD8c'><dir id='nxD8c'><q id='nxD8c'></q></dir></style></legend>

    2. <i id='nxD8c'><tr id='nxD8c'><dt id='nxD8c'><q id='nxD8c'><span id='nxD8c'><b id='nxD8c'><form id='nxD8c'><ins id='nxD8c'></ins><ul id='nxD8c'></ul><sub id='nxD8c'></sub></form><legend id='nxD8c'></legend><bdo id='nxD8c'><pre id='nxD8c'><center id='nxD8c'></center></pre></bdo></b><th id='nxD8c'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nxD8c'><tfoot id='nxD8c'></tfoot><dl id='nxD8c'><fieldset id='nxD8c'></fieldset></dl></div>

      <small id='nxD8c'></small><noframes id='nxD8c'>

        <bdo id='nxD8c'></bdo><ul id='nxD8c'></ul>
      1. 將 pandas 數據框列導入為字符串而不是 int

        Import pandas dataframe column as string not int(將 pandas 數據框列導入為字符串而不是 int)
          <tbody id='tm8ko'></tbody>
          • <legend id='tm8ko'><style id='tm8ko'><dir id='tm8ko'><q id='tm8ko'></q></dir></style></legend>

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

                <small id='tm8ko'></small><noframes id='tm8ko'>

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

                  <tfoot id='tm8ko'></tfoot>
                1. 本文介紹了將 pandas 數據框列導入為字符串而不是 int的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想將以下 csv 作為字符串而不是 int64 導入.Pandas read_csv 自動將其轉換為 int64,但我需要此列作為字符串.

                  I would like to import the following csv as strings not as int64. Pandas read_csv automatically converts it to int64, but I need this column as string.

                  ID
                  00013007854817840016671868
                  00013007854817840016749251
                  00013007854817840016754630
                  00013007854817840016781876
                  00013007854817840017028824
                  00013007854817840017963235
                  00013007854817840018860166
                  
                  
                  df = read_csv('sample.csv')
                  
                  df.ID
                  >>
                  
                  0   -9223372036854775808
                  1   -9223372036854775808
                  2   -9223372036854775808
                  3   -9223372036854775808
                  4   -9223372036854775808
                  5   -9223372036854775808
                  6   -9223372036854775808
                  Name: ID
                  

                  不幸的是,使用轉換器會得到相同的結果.

                  Unfortunately using converters gives the same result.

                  df = read_csv('sample.csv', converters={'ID': str})
                  df.ID
                  >>
                  
                  0   -9223372036854775808
                  1   -9223372036854775808
                  2   -9223372036854775808
                  3   -9223372036854775808
                  4   -9223372036854775808
                  5   -9223372036854775808
                  6   -9223372036854775808
                  Name: ID
                  

                  推薦答案

                  只是想重申這將適用于 pandas >= 0.9.1:

                  Just want to reiterate this will work in pandas >= 0.9.1:

                  In [2]: read_csv('sample.csv', dtype={'ID': object})
                  Out[2]: 
                                             ID
                  0  00013007854817840016671868
                  1  00013007854817840016749251
                  2  00013007854817840016754630
                  3  00013007854817840016781876
                  4  00013007854817840017028824
                  5  00013007854817840017963235
                  6  00013007854817840018860166
                  

                  我也在創建一個關于檢測整數溢出的問題.

                  I'm creating an issue about detecting integer overflows also.

                  在此處查看解決方案:https://github.com/pydata/pandas/issues/2247

                  更新,因為它可以幫助他人:

                  Update as it helps others:

                  要將所有列作為str,可以這樣做(來自評論):

                  To have all columns as str, one can do this (from the comment):

                  pd.read_csv('sample.csv', dtype = str)
                  

                  要將大多數或選擇性列作為str,可以這樣做:

                  To have most or selective columns as str, one can do this:

                  # lst of column names which needs to be string
                  lst_str_cols = ['prefix', 'serial']
                  # use dictionary comprehension to make dict of dtypes
                  dict_dtypes = {x : 'str'  for x in lst_str_cols}
                  # use dict on dtypes
                  pd.read_csv('sample.csv', dtype=dict_dtypes)
                  

                  這篇關于將 pandas 數據框列導入為字符串而不是 int的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 100%)
                  How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)
                2. <tfoot id='A7qTJ'></tfoot>

                  1. <legend id='A7qTJ'><style id='A7qTJ'><dir id='A7qTJ'><q id='A7qTJ'></q></dir></style></legend>
                      <bdo id='A7qTJ'></bdo><ul id='A7qTJ'></ul>
                            <tbody id='A7qTJ'></tbody>

                          <small id='A7qTJ'></small><noframes id='A7qTJ'>

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

                          • 主站蜘蛛池模板: av在线免费播放 | 日韩一区二区三区av | 99成人免费视频 | 中文字幕91av| 在线观看成人精品 | 国产一区二区三区四区 | 午夜在线视频 | 国产精品一区久久久 | 天天操综合网站 | 精品国产欧美一区二区三区成人 | 美日韩免费| 亚洲a一区 | 欧美精品久久久久久久久老牛影院 | 亚洲网站在线观看 | 国产一二区视频 | 欧美日韩国产精品一区二区 | 91视频在线观看免费 | 毛片网站免费观看 | 一区二区三区欧美大片 | 亚洲福利 | 久久草在线视频 | 小h片免费观看久久久久 | 精品1区2区3区 | 91精品久久久 | 欧美在线一区二区三区 | 亚洲国产一区视频 | 啪啪毛片 | 国产精品揄拍一区二区 | 一级片在线观看 | 最新日韩在线 | 天天操网 | 狠狠入ady亚洲精品经典电影 | 欧美成年黄网站色视频 | 在线视频国产一区 | 成人国产精品久久久 | 久久久精品 | 欧美成ee人免费视频 | 久久久久久久久蜜桃 | 亚洲一区二区三区在线免费观看 | 亚洲欧美综合网 | 中文字幕韩在线第一页 |