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

    • <bdo id='osQNc'></bdo><ul id='osQNc'></ul>
  • <small id='osQNc'></small><noframes id='osQNc'>

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

        <legend id='osQNc'><style id='osQNc'><dir id='osQNc'><q id='osQNc'></q></dir></style></legend>
      1. 為 pandas.read_csv 指定正確的 dtypes 以獲取日期時(shí)間

        Specify correct dtypes to pandas.read_csv for datetimes and booleans(為 pandas.read_csv 指定正確的 dtypes 以獲取日期時(shí)間和布爾值)

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

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

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

                    <tbody id='hQTZr'></tbody>
                1. 本文介紹了為 pandas.read_csv 指定正確的 dtypes 以獲取日期時(shí)間和布爾值的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在將 csv 文件加載到 Pandas DataFrame 中.對(duì)于每一列,如何使用 dtype 參數(shù)指定它包含的數(shù)據(jù)類型?

                  I am loading a csv file into a Pandas DataFrame. For each column, how do I specify what type of data it contains using the dtype argument?

                  • 我可以使用 numeric 數(shù)據(jù)(代碼在底部)...
                  • 但是如何指定時(shí)間數(shù)據(jù)...
                  • 分類數(shù)據(jù),例如因子或布爾值?我試過(guò) np.bool_pd.tslib.Timestamp 沒(méi)有運(yùn)氣.
                  • I can do it with numeric data (code at bottom)...
                  • But how do I specify time data...
                  • and categorical data such as factors or booleans? I have tried np.bool_ and pd.tslib.Timestamp without luck.

                  代碼:

                  import pandas as pd
                  import numpy as np
                  df = pd.read_csv(<file-name>, dtype={'A': np.int64, 'B': np.float64})
                  

                  推薦答案

                  read_csv 有很多選項(xiàng)可以處理你提到的所有情況.您可能想嘗試 dtype={'A': datetime.datetime},但通常您不需要 dtypes,因?yàn)?pandas 可以推斷類型.

                  There are a lot of options for read_csv which will handle all the cases you mentioned. You might want to try dtype={'A': datetime.datetime}, but often you won't need dtypes as pandas can infer the types.

                  對(duì)于日期,則需要指定 parse_date 選項(xiàng):

                  parse_dates : boolean, list of ints or names, list of lists, or dict
                  keep_date_col : boolean, default False
                  date_parser : function
                  

                  一般來(lái)說(shuō),要轉(zhuǎn)換布爾值,您需要指定:

                  true_values  : list  Values to consider as True
                  false_values : list  Values to consider as False
                  

                  這會(huì)將列表中的任何值轉(zhuǎn)換為布爾值 true/false.對(duì)于更一般的轉(zhuǎn)換,您很可能需要

                  Which will transform any value in the list to the boolean true/false. For more general conversions you will most likely need

                  轉(zhuǎn)換器:字典.用于轉(zhuǎn)換某些列中的值的可選函數(shù)字典.鍵可以是整數(shù)或列標(biāo)簽

                  converters : dict. optional Dict of functions for converting values in certain columns. Keys can either be integers or column labels

                  雖然密集,但請(qǐng)?jiān)诖颂幉榭赐暾斜?http://pandas.pydata.org/pandas-docs/stable/generated/pandas.io.parsers.read_csv.html

                  Though dense, check here for the full list: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.io.parsers.read_csv.html

                  這篇關(guān)于為 pandas.read_csv 指定正確的 dtypes 以獲取日期時(shí)間和布爾值的文章就介紹到這了,希望我們推薦的答案對(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)文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數(shù)綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動(dòng)后進(jìn)度躍升至 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 刻度標(biāo)簽設(shè)置在固定位置,以便當(dāng)我向左或向右滾動(dòng)時(shí),yaxis 刻度標(biāo)簽應(yīng)該可見(jiàn)
                  `QImage` constructor has unknown keyword `data`(`QImage` 構(gòu)造函數(shù)有未知關(guān)鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時(shí)顯示進(jìn)度條?)

                      <bdo id='X6cVe'></bdo><ul id='X6cVe'></ul>

                          <tbody id='X6cVe'></tbody>

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

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

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

                          • 主站蜘蛛池模板: 日韩精品久久一区二区三区 | 美女在线观看av | 久久99精品久久久久久国产越南 | 国产成人久久精品一区二区三区 | 久久小视频 | 日本一区二区三区四区 | 欧美1页| 日韩中出 | 日本精品久久 | 天天久久| 国产午夜精品一区二区三区四区 | 午夜成人免费电影 | 久久久久www | 国产成人免费 | 在线视频日韩 | 国产精品日韩欧美一区二区三区 | 亚洲精品在线免费 | 韩日在线视频 | 欧美xxxx做受欧美 | 免费黄网站在线观看 | 国产精品久久国产精品 | 午夜电影在线播放 | 国产乱码精品1区2区3区 | 欧美一级毛片久久99精品蜜桃 | 精品美女在线观看视频在线观看 | 国产真实乱全部视频 | 日韩电影一区 | 国产欧美一区二区三区免费 | 国产精品片aa在线观看 | 午夜电影福利 | 国产午夜精品一区二区三区四区 | 青青草视频网 | 久久精品国产一区二区三区不卡 | 91视频国产一区 | 99综合网 | 精品国产乱码久久久久久牛牛 | 91国产视频在线观看 | 亚洲小视频 | 日韩成人免费中文字幕 | 久久综合一区 | 国产成人精品午夜视频免费 |