久久久久久久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. 主站蜘蛛池模板: 亚洲a视| 日韩中出 | 亚洲欧洲成人av每日更新 | 91国产在线播放 | 男女搞网站 | 精品在线一区 | com.色.www在线观看 | www日日日 | 久久久久久久久淑女av国产精品 | 亚洲高清在线观看 | 激情六月丁香婷婷 | 羞羞的视频免费在线观看 | 狠狠的干狠狠的操 | 亚洲一区二区三区在线播放 | 精品亚洲一区二区 | 欧美激情一区二区三区 | 日韩a视频 | 成人h片在线观看 | 中文字幕在线中文 | 欧美日韩一区二区在线 | 欧美日韩在线电影 | 国产欧美在线 | 北条麻妃99精品青青久久主播 | 亚洲一区 中文字幕 | 欧美激情免费在线 | 国产免费色 | 在线观看成年视频 | 免费av毛片 | 国产精品夜夜春夜夜爽久久电影 | 日本黄色激情视频 | 国产乱码精品一区二区三区忘忧草 | 丝袜一区二区三区 | 黄网站免费在线观看 | 日本午夜在线视频 | 久久9精品 | 婷婷不卡 | 99热这里有精品 | 亚洲欧美日韩电影 | 国产精品欧美一区二区三区不卡 | 久久免费国产 | 国产日韩精品一区 |