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

      • <bdo id='97Bhv'></bdo><ul id='97Bhv'></ul>

      <small id='97Bhv'></small><noframes id='97Bhv'>

      <legend id='97Bhv'><style id='97Bhv'><dir id='97Bhv'><q id='97Bhv'></q></dir></style></legend>

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

      2. 如何在 Pandas 中轉換 datetime 列的時區?

        How to convert time zones of datetime column in Pandas?(如何在 Pandas 中轉換 datetime 列的時區?)

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

            <tfoot id='1ZWi6'></tfoot>

            <small id='1ZWi6'></small><noframes id='1ZWi6'>

                  <tbody id='1ZWi6'></tbody>

                  <bdo id='1ZWi6'></bdo><ul id='1ZWi6'></ul>
                  <legend id='1ZWi6'><style id='1ZWi6'><dir id='1ZWi6'><q id='1ZWi6'></q></dir></style></legend>
                  本文介紹了如何在 Pandas 中轉換 datetime 列的時區?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一列(非索引列),其中包含日期時間.例如,前五個條目如下所示:

                  I have a column (non-index column) that has datetimes inside it. For example, the first five entries look something like this:

                  [Timestamp('2018-11-15 19:57:55'),
                   Timestamp('2018-11-15 19:59:46'),
                   Timestamp('2018-11-15 20:00:59'),
                   Timestamp('2018-11-15 20:01:41'),
                   Timestamp('2018-11-15 20:01:54')]
                  

                  我想將條目從 UTC 轉換為太平洋時區.假設該列被稱為 times 我目前正在執行以下操作:

                  I want to convert the entries from UTC to the Pacific timezone. Assuming the column is called times I am currently doing the following:

                  times.dt.tz_localize('GMT').dt.tz_convert('America/Los_Angeles')

                  雖然這成功地將列從 UTC 轉換為 PST,但輸出包含我不想要的無關組件.如下所示:

                  While this successfully converts the column from UTC to PST, the output has extraneous components that I do not want. It looks like the following:

                  [Timestamp('2018-11-15 11:57:55-0800', tz='America/Los_Angeles'),
                   Timestamp('2018-11-15 11:59:46-0800', tz='America/Los_Angeles'),
                   Timestamp('2018-11-15 12:00:59-0800', tz='America/Los_Angeles'),
                   Timestamp('2018-11-15 12:01:41-0800', tz='America/Los_Angeles'),
                   Timestamp('2018-11-15 12:01:54-0800', tz='America/Los_Angeles')]
                  

                  如何從時間戳中刪除或忽略 -0800?謝謝!

                  How do I remove or ignore the -0800 from the timestamps? Thanks!

                  推薦答案

                  只需添加最后一步.tz_localize(None):

                  import pandas as pd
                  d = pd.Series(['2018-11-15 19:57:55', '2018-11-15 19:59:46'])
                  d = pd.to_datetime(d)
                  d
                  0   2018-11-15 19:57:55
                  1   2018-11-15 19:59:46
                  dtype: datetime64[ns]
                  
                  d_pacific_tz_aware = d.dt.tz_localize("GMT").dt.tz_convert('America/Los_Angeles')
                  d_pacific_tz_aware
                  0   2018-11-15 11:57:55-08:00
                  1   2018-11-15 11:59:46-08:00
                  dtype: datetime64[ns, America/Los_Angeles]
                  
                  
                  d_pacific_tz_naive = d.dt.tz_localize("GMT").dt.tz_convert('America/Los_Angeles').dt.tz_localize(None)
                  d_pacific_tz_naive
                  0   2018-11-15 11:57:55
                  1   2018-11-15 11:59:46
                  dtype: datetime64[ns]
                  

                  這篇關于如何在 Pandas 中轉換 datetime 列的時區?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 包)
                    <tfoot id='US35P'></tfoot>

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

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

                              <tbody id='US35P'></tbody>
                          1. 主站蜘蛛池模板: 中文字幕日本一区二区 | 超碰高清| 久久国产欧美日韩精品 | 色在线免费 | 国产中文区二幕区2012 | 国产精品久久久久一区二区三区 | 视频一区在线观看 | 亚洲综合在线一区 | 日本激情视频在线播放 | 日本一区二区高清视频 | 国产精品国产a | 中文字幕加勒比 | 欧美日韩一区二区在线 | 成人福利片 | 国产成人午夜精品影院游乐网 | 黄色成人av | 国产精品不卡一区 | 亚洲国产aⅴ成人精品无吗 国产精品永久在线观看 | 国产资源在线观看 | 一色桃子av一区二区 | 成人依人 | 中文字幕亚洲一区二区va在线 | 伊人av在线播放 | 亚洲高清久久 | 日韩激情网 | 永久www成人看片 | 日韩一区二区在线视频 | 日韩av手机在线观看 | 午夜手机在线视频 | 福利视频一区 | 中日韩欧美一级片 | 日韩精品一区在线 | 狠狠狠| 毛片久久久 | 日韩2020狼一二三 | 91久久久久久久久 | 一区二区三区在线免费观看视频 | 欧美精品一区二区三区在线 | 91精品久久久久久久久中文字幕 | 国产综合视频 | 在线免费国产视频 |