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

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

    <tfoot id='CSFht'></tfoot>

          <bdo id='CSFht'></bdo><ul id='CSFht'></ul>
      1. <legend id='CSFht'><style id='CSFht'><dir id='CSFht'><q id='CSFht'></q></dir></style></legend>
      2. 在mongodb中保存numpy數組

        Saving numpy array in mongodb(在mongodb中保存numpy數組)

          <tbody id='lXrrU'></tbody>
          <bdo id='lXrrU'></bdo><ul id='lXrrU'></ul>
          • <small id='lXrrU'></small><noframes id='lXrrU'>

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

                <tfoot id='lXrrU'></tfoot>

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

                  本文介紹了在mongodb中保存numpy數組的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有幾個 MongoDB 文檔,其中一個字段最好表示為矩陣(numpy 數組).我想將此文檔保存到 MongoDB,我該怎么做?

                  I have a couple of MongoDB documents wherein one my the fields is best represented as a matrix (numpy array). I would like to save this document to MongoDB, how do I do this?

                  {
                  'name' : 'subject1',
                  'image_name' : 'blah/foo.png',
                  'feature1' : np.array(...)
                  }
                  

                  推薦答案

                  對于一維 numpy 數組,可以使用列表:

                  For a 1D numpy array, you can use lists:

                  # serialize 1D array x
                  record['feature1'] = x.tolist()
                  
                  # deserialize 1D array x
                  x = np.fromiter( record['feature1'] )
                  

                  對于多維數據,我相信你需要使用pickle和pymongo.binary.Binary:

                  For multidimensional data, I believe you'll need to use pickle and pymongo.binary.Binary:

                  # serialize 2D array y
                  record['feature2'] = pymongo.binary.Binary( pickle.dumps( y, protocol=2) ) )
                  
                  # deserialize 2D array y
                  y = pickle.loads( record['feature2'] )
                  

                  這篇關于在mongodb中保存numpy數組的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造python包)
                  Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                  How to refresh sys.path?(如何刷新 sys.path?)
                  Distribute a Python package with a compiled dynamic shared library(分發帶有已編譯動態共享庫的 Python 包)
                    <tbody id='2MPON'></tbody>
                      <i id='2MPON'><tr id='2MPON'><dt id='2MPON'><q id='2MPON'><span id='2MPON'><b id='2MPON'><form id='2MPON'><ins id='2MPON'></ins><ul id='2MPON'></ul><sub id='2MPON'></sub></form><legend id='2MPON'></legend><bdo id='2MPON'><pre id='2MPON'><center id='2MPON'></center></pre></bdo></b><th id='2MPON'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2MPON'><tfoot id='2MPON'></tfoot><dl id='2MPON'><fieldset id='2MPON'></fieldset></dl></div>

                          <bdo id='2MPON'></bdo><ul id='2MPON'></ul>
                          <tfoot id='2MPON'></tfoot>

                        • <small id='2MPON'></small><noframes id='2MPON'>

                            <legend id='2MPON'><style id='2MPON'><dir id='2MPON'><q id='2MPON'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 中文在线观看视频 | 黄视频免费观看 | 91大神在线资源观看无广告 | 看真人视频一级毛片 | 欧美精品一区二区在线观看 | 国产一区二区 | www.国产日本 | 亚洲第一av | 日本天天操 | 日日操操 | 日韩在线免费播放 | 成人在线免费网站 | 欧美黑人体内she精在线观看 | 91久久综合 | av在线播放网址 | 久久精点视频 | 免费看a | 国产精品精品久久久 | 91精品国产一区二区三区 | 亚洲精品久久久久久首妖 | h在线播放 | 午夜免费视频 | 国产免费又色又爽又黄在线观看 | 国产女人与拘做受免费视频 | 国产精品国产精品 | 一级在线视频 | 欧美区在线观看 | 久久免费视频2 | 91pron在线| 高清黄色网址 | 成人精品一区二区 | 成人精品在线观看 | 久久人人国产 | 欧美日韩国产高清视频 | 精品国产一区三区 | 亚洲精品成人免费 | 综合一区二区三区 | 久久久成人精品 | 亚洲狠狠| 国产一区二区久久 | 日韩精品一区二区三区视频播放 |