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

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

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

    1. <small id='w32dX'></small><noframes id='w32dX'>

        <tfoot id='w32dX'></tfoot>
      1. 在 pandas.Series 中將時(shí)間戳轉(zhuǎn)換為 datetime.datetime

        convert timestamp to datetime.datetime in pandas.Series(在 pandas.Series 中將時(shí)間戳轉(zhuǎn)換為 datetime.datetime)

        <tfoot id='DlGSp'></tfoot>
          <tbody id='DlGSp'></tbody>
      2. <small id='DlGSp'></small><noframes id='DlGSp'>

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

            <legend id='DlGSp'><style id='DlGSp'><dir id='DlGSp'><q id='DlGSp'></q></dir></style></legend>
                • <bdo id='DlGSp'></bdo><ul id='DlGSp'></ul>

                  本文介紹了在 pandas.Series 中將時(shí)間戳轉(zhuǎn)換為 datetime.datetime的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有熊貓系列,其中索引是整數(shù)列表(時(shí)間戳),我如何將它們轉(zhuǎn)換為 datetime.datetime(帶時(shí)區(qū))比以下原始轉(zhuǎn)換更有效?

                  I have pandas Series where index is a list of integer (timestamp), how can I convert them to datetime.datetime (with timezone) more efficient than below raw conversion?

                  pd.Series(data=s.values, index=map(lambda x:datetime.datetime.fromtimestamp(x,tz=utc), s.index))
                  

                  推薦答案

                  In [49]: s = Series(range(10))
                  

                  使用to_datetime,你可以提供一個(gè)單位來選擇整數(shù)的含義.

                  Using to_datetime, you can supply a unit to select what the meaning of the integers.

                  In [50]: pd.to_datetime(s,unit='s')
                  Out[50]: 
                  0   1970-01-01 00:00:00
                  1   1970-01-01 00:00:01
                  2   1970-01-01 00:00:02
                  3   1970-01-01 00:00:03
                  4   1970-01-01 00:00:04
                  5   1970-01-01 00:00:05
                  6   1970-01-01 00:00:06
                  7   1970-01-01 00:00:07
                  8   1970-01-01 00:00:08
                  9   1970-01-01 00:00:09
                  dtype: datetime64[ns]
                  
                  In [51]: pd.to_datetime(s,unit='ms')
                  Out[51]: 
                  0          1970-01-01 00:00:00
                  1   1970-01-01 00:00:00.001000
                  2   1970-01-01 00:00:00.002000
                  3   1970-01-01 00:00:00.003000
                  4   1970-01-01 00:00:00.004000
                  5   1970-01-01 00:00:00.005000
                  6   1970-01-01 00:00:00.006000
                  7   1970-01-01 00:00:00.007000
                  8   1970-01-01 00:00:00.008000
                  9   1970-01-01 00:00:00.009000
                  dtype: datetime64[ns]
                  
                  In [52]: pd.to_datetime(s,unit='D')
                  Out[52]: 
                  0   1970-01-01
                  1   1970-01-02
                  2   1970-01-03
                  3   1970-01-04
                  4   1970-01-05
                  5   1970-01-06
                  6   1970-01-07
                  7   1970-01-08
                  8   1970-01-09
                  9   1970-01-10
                  dtype: datetime64[ns]
                  

                  創(chuàng)建一個(gè)系列就很簡(jiǎn)單了

                  Creating a Series is then straightforward

                  In [54]: Series(s.values,index=pd.to_datetime(s,unit='s'))
                  Out[54]: 
                  1970-01-01 00:00:00    0
                  1970-01-01 00:00:01    1
                  1970-01-01 00:00:02    2
                  1970-01-01 00:00:03    3
                  1970-01-01 00:00:04    4
                  1970-01-01 00:00:05    5
                  1970-01-01 00:00:06    6
                  1970-01-01 00:00:07    7
                  1970-01-01 00:00:08    8
                  1970-01-01 00:00:09    9
                  dtype: int64
                  

                  這篇關(guān)于在 pandas.Series 中將時(shí)間戳轉(zhuǎn)換為 datetime.datetime的文章就介紹到這了,希望我們推薦的答案對(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)共享庫(kù)的 Python 包)
                      <tbody id='mAnyg'></tbody>

                    <tfoot id='mAnyg'></tfoot>
                        <legend id='mAnyg'><style id='mAnyg'><dir id='mAnyg'><q id='mAnyg'></q></dir></style></legend>
                          <bdo id='mAnyg'></bdo><ul id='mAnyg'></ul>

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

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

                            主站蜘蛛池模板: 日韩欧美在线播放 | 国产精品国产三级国产a | 少妇一级淫片免费放播放 | 亚洲福利一区 | 国产精品国产精品国产专区不片 | 国产精彩视频在线观看 | 国产精品综合视频 | 亚洲第1页| 精品1区| 九色视频网 | 日韩日韩日韩日韩日韩日韩日韩 | 亚洲欧美久久 | 中文字幕一区二区三区不卡在线 | 久久的色 | 国产亚洲精品91 | 91视频免费黄 | 一级黄色片网站 | 一区二区在线免费观看 | 国产激情网 | 激情毛片 | 免费毛片网 | 国产精品海角社区在线观看 | 欧美日韩久久久 | 欧美日韩视频网站 | 日本不卡一区 | 国产精品一区二区电影 | 99re热精品视频 | 91免费在线看 | 九九热精品在线 | 99福利在线观看 | 成人三级av| 成人免费大片黄在线播放 | 性高湖久久久久久久久aaaaa | 午夜精品一区二区三区免费视频 | 国产精品日韩欧美一区二区三区 | 欧美激情国产精品 | h视频免费观看 | 欧美片网站免费 | 欧美精品区 | 国产一区二区在线免费播放 | 欧美久久久久 |