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

  1. <small id='2TV9R'></small><noframes id='2TV9R'>

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

    2. 如何解決 AttributeError:'list' 對(duì)象沒(méi)有屬性

      How to solve the AttributeError:#39;list#39; object has no attribute #39;astype#39;?(如何解決 AttributeError:list 對(duì)象沒(méi)有屬性 astype?)
      <legend id='i8O8B'><style id='i8O8B'><dir id='i8O8B'><q id='i8O8B'></q></dir></style></legend>

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

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

            <tfoot id='i8O8B'></tfoot>
              <bdo id='i8O8B'></bdo><ul id='i8O8B'></ul>

                本文介紹了如何解決 AttributeError:'list' 對(duì)象沒(méi)有屬性 'astype'?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                我只是想知道如何解決python3.6中的屬性錯(cuò)誤.錯(cuò)誤是

                I am just wondering how to solve the attribute error in python3.6. The error is

                'list' 對(duì)象沒(méi)有屬性 'astype'.

                'list' object has no attribute 'astype'.

                我的相關(guān)代碼也是爆款.

                My related code is as blow.

                def _init_mean_std(self, data):
                    data = data.astype('float32')
                    self.mean, self.std = np.mean(data), np.std(data)
                    self.save_meanstd()
                    return data
                

                有人可以給我建議嗎?

                謝謝!

                推薦答案

                根本問(wèn)題是 Python 列表和 NumPy 數(shù)組的混淆,它們是不同的數(shù)據(jù)類型.作為 np.foo(array) 調(diào)用的 NumPy 方法通常不會(huì)抱怨,如果你給他們一個(gè) Python 列表,他們會(huì)默默地將它轉(zhuǎn)換為 NumPy 數(shù)組.但是,如果您嘗試調(diào)用對(duì)象中包含的方法,例如 array.foo(),那么它當(dāng)然必須已經(jīng)具有適當(dāng)?shù)念愋?

                The root issue is confusion of Python lists and NumPy arrays, which are different data types. NumPy methods that are invoked as np.foo(array) usually won't complain if you give them a Python list, they will convert it to an NumPy array silently. But if you try to invoke a method contained in the object, like array.foo() then of course it has to have the appropriate type already.

                我建議使用

                data = np.array(data, dtype=np.float32)
                

                以便 NumPy 立即知道數(shù)組的類型.這避免了您首先創(chuàng)建一個(gè)數(shù)組然后將其轉(zhuǎn)換為另一種類型的不必要的工作.

                so that the type of an array is known to NumPy at once. This avoids unnecessary work where you first create an array and then cast it to another type.

                NumPy 建議使用 dtype 對(duì)象像float32"這樣的字符串.

                NumPy recommends using dtype objects instead of strings like "float32".

                這篇關(guān)于如何解決 AttributeError:'list' 對(duì)象沒(méi)有屬性 'astype'?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(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)共享庫(kù)的 Python 包)
                <tfoot id='70Dpz'></tfoot>

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

                        <tbody id='70Dpz'></tbody>
                    1. <legend id='70Dpz'><style id='70Dpz'><dir id='70Dpz'><q id='70Dpz'></q></dir></style></legend>

                        <small id='70Dpz'></small><noframes id='70Dpz'>

                          <bdo id='70Dpz'></bdo><ul id='70Dpz'></ul>

                          主站蜘蛛池模板: 天天操夜夜艹 | 国产精品中文字幕在线 | 国产婷婷色综合av蜜臀av | 久久久精彩视频 | 久久久久久久久久性 | 欧美精品一区二区三区在线播放 | 亚洲高清在线免费观看 | 亚洲 成人 av | 一区二区三区亚洲 | 欧美精品一区二区三区在线播放 | av中文字幕在线观看 | 欧美一区二区在线播放 | 97视频成人| 国产高清精品一区二区三区 | 亚洲在线一区二区 | www.亚洲国产精品 | 日韩一区二区在线观看 | 99亚洲精品| 久久亚洲二区 | 亚洲免费在线 | 成人欧美一区二区三区白人 | 中文一区 | 欧美一区二区三区视频在线 | 精品国产免费一区二区三区演员表 | av手机在线播放 | 午夜专区 | 国产一区日韩在线 | 成人不卡一区二区 | 91精品国产乱码久久久久久久久 | 天天干亚洲 | 日韩视频精品在线 | 国产亚洲一区二区三区 | av天天干 | 亚洲欧洲精品成人久久奇米网 | 亚洲人人 | 天天成人综合网 | 久久久www成人免费精品 | 91精品国产色综合久久不卡98 | 国产精品一区一区三区 | 中文字幕一区二区三区四区五区 | 亚洲欧美国产一区二区三区 |