久久久久久久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數(shù)組

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

          <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數(shù)組的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有幾個(gè) MongoDB 文檔,其中一個(gè)字段最好表示為矩陣(numpy 數(shù)組).我想將此文檔保存到 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(...)
                  }
                  

                  推薦答案

                  對(duì)于一維 numpy 數(shù)組,可以使用列表:

                  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'] )
                  

                  對(duì)于多維數(shù)據(jù),我相信你需要使用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'] )
                  

                  這篇關(guān)于在mongodb中保存numpy數(shù)組的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個(gè)模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點(diǎn)包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復(fù)導(dǎo)入頂級(jí)名稱的情況下構(gòu)造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(分發(fā)帶有已編譯動(dòng)態(tài)共享庫的 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一级片| 日本成人一区二区 | 97在线播放 | 日韩欧美专区 | 久久机热这里只有精品 | 婷婷av在线 | 免费视频一区二区 | 国产视频一二三区 | 欧美成人精品一区二区三区 | 成人精品免费视频 | 天天爽夜夜操 | 欧美69视频 | 国产日韩精品一区二区 | 日韩在线视频播放 | 日韩午夜在线观看 | 日本一区二区三区精品 | 在线亚洲天堂 | www婷婷| 欧美激情综合 | 99av| 国产福利在线播放 | 国产激情视频在线观看 | 欧美狠狠操 | 成年免费视频黄网站在线观看 | 天天操天 | 一区二区三区四区在线视频 | 中文字幕一区在线观看 | 91看片在线观看 | 国产成人+综合亚洲+天堂 | 青娱乐av | 97精品| 国 产 黄 色 大 片 | 91成人在线观看喷潮蘑菇 | 亚洲免费看片 | 国产精品视频一区二区三区 | 欧美天堂| 国产日韩欧美一区二区 | 亚洲激情综合网 | 中文在线免费观看 |