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

  • <tfoot id='TN6uh'></tfoot>

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

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

        NumPy 或 Pandas:將數組類型保持為整數,同時具有

        NumPy or Pandas: Keeping array type as integer while having a NaN value(NumPy 或 Pandas:將數組類型保持為整數,同時具有 NaN 值)

      2. <tfoot id='DSHGG'></tfoot>

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

          <legend id='DSHGG'><style id='DSHGG'><dir id='DSHGG'><q id='DSHGG'></q></dir></style></legend>

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

              <bdo id='DSHGG'></bdo><ul id='DSHGG'></ul>
                • 本文介紹了NumPy 或 Pandas:將數組類型保持為整數,同時具有 NaN 值的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  是否有一種首選方法可以將 numpy 數組的數據類型固定為 int (或 int64 或其他),同時仍然里面有一個元素列為 numpy.NaN?

                  Is there a preferred way to keep the data type of a numpy array fixed as int (or int64 or whatever), while still having an element inside listed as numpy.NaN?

                  特別是,我正在將內部數據結構轉換為 Pandas DataFrame.在我們的結構中,我們有仍然有 NaN 的整數類型列(但列的 dtype 是 int).如果我們將其設為 DataFrame,似乎會將所有內容重鑄為浮點數,但我們真的很想成為 int.

                  In particular, I am converting an in-house data structure to a Pandas DataFrame. In our structure, we have integer-type columns that still have NaN's (but the dtype of the column is int). It seems to recast everything as a float if we make this a DataFrame, but we'd really like to be int.

                  想法?

                  嘗試過的事情:

                  我嘗試使用 pandas.DataFrame 下的 from_records() 函數和 coerce_float=False 但這沒有幫助.我還嘗試使用 NumPy 掩碼數組和 NaN fill_value,這也不起作用.所有這些都導致列數據類型變為浮點數.

                  I tried using the from_records() function under pandas.DataFrame, with coerce_float=False and this did not help. I also tried using NumPy masked arrays, with NaN fill_value, which also did not work. All of these caused the column data type to become a float.

                  推薦答案

                  此功能已添加到 pandas(從 0.24 版本開始):https://pandas.pydata.org/pandas-docs/version/0.24/whatsnew/v0.24.0.html#optional-integer-na-support

                  This capability has been added to pandas (beginning with version 0.24): https://pandas.pydata.org/pandas-docs/version/0.24/whatsnew/v0.24.0.html#optional-integer-na-support

                  此時,它需要使用擴展dtype Int64(大寫),而不是默認dtype int64(小寫).

                  At this point, it requires the use of extension dtype Int64 (capitalized), rather than the default dtype int64 (lowercase).

                  這篇關于NumPy 或 Pandas:將數組類型保持為整數,同時具有 NaN 值的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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時顯示進度條?)
                • <small id='3gOEP'></small><noframes id='3gOEP'>

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

                      <legend id='3gOEP'><style id='3gOEP'><dir id='3gOEP'><q id='3gOEP'></q></dir></style></legend>
                        1. <tfoot id='3gOEP'></tfoot>
                            <tbody id='3gOEP'></tbody>

                          1. 主站蜘蛛池模板: 久久av影院| 三级网站视频 | 欧美亚洲视频 | 久久九九热 | 中文在线视频 | 在线观看一区 | 亚洲视频免费 | 久久免费影院 | 日日操夜夜 | 午夜精品久久久久久久久久久久 | 亚洲午夜精品一区二区三区 | 黄色a网站| 伊人干综合 | 成人免费视频视频 | 伊人天堂网 | 欧美一级色 | 国产亚洲欧美日韩高清 | 亚洲一区二区三区免费 | 国产午夜精品一区二区三区视频 | 一区二区三区四区视频在线观看 | 韩日在线视频 | 午夜视频免费看 | 国产精品国产精品国产专区不卡 | av狠狠干| 精品日韩在线 | 男人添女人囗交图 | 日本在线看片 | 精品一区在线播放 | 亚洲精品乱码久久久久久动漫 | 一区二区三区视频在线 | 成人涩涩 | 亚洲精品免费看 | 国产成人av在线 | 综合久久久 | 日韩久久久久 | 长河落日 | 日韩欧美中文在线 | 香蕉在线播放 | 99精品国产一区二区 | 亚洲天堂一区二区三区 | 国产精品久久一区 |