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

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

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

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

        pandas 時間從UTC到本地

        pandas time shift from utc to local( pandas 時間從UTC到本地)
          <bdo id='Btx6o'></bdo><ul id='Btx6o'></ul>
        • <i id='Btx6o'><tr id='Btx6o'><dt id='Btx6o'><q id='Btx6o'><span id='Btx6o'><b id='Btx6o'><form id='Btx6o'><ins id='Btx6o'></ins><ul id='Btx6o'></ul><sub id='Btx6o'></sub></form><legend id='Btx6o'></legend><bdo id='Btx6o'><pre id='Btx6o'><center id='Btx6o'></center></pre></bdo></b><th id='Btx6o'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Btx6o'><tfoot id='Btx6o'></tfoot><dl id='Btx6o'><fieldset id='Btx6o'></fieldset></dl></div>
          <tfoot id='Btx6o'></tfoot>
          <legend id='Btx6o'><style id='Btx6o'><dir id='Btx6o'><q id='Btx6o'></q></dir></style></legend>

              <tbody id='Btx6o'></tbody>

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

                • 本文介紹了 pandas 時間從UTC到本地的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試將 UTC 時間轉換為本地時間.這是我之前的經歷

                  I am trying to convert utc time to local time. This is what I had before

                  df_combined_features['timestamp'][1:10]
                  2013-01-24   2013-01-24 11:00:00
                  2013-04-25   2013-04-25 10:00:00
                  2013-07-25   2013-07-25 10:00:00
                  2013-10-24   2013-10-24 10:00:00
                  2014-01-30   2014-01-30 11:00:00
                  2014-04-24   2014-04-24 10:00:00
                  2014-07-24   2014-07-24 10:00:00
                  2014-10-23   2014-10-23 10:00:00
                  2015-01-27   2015-01-27 11:00:00
                  

                  這就是我所做的

                  df_combined_features['time_stamp'].tz_localize('US/Central')[1:10]
                  2013-01-24 00:00:00-06:00   2013-01-24 11:00:00
                  2013-04-25 00:00:00-05:00   2013-04-25 10:00:00
                  2013-07-25 00:00:00-05:00   2013-07-25 10:00:00
                  2013-10-24 00:00:00-05:00   2013-10-24 10:00:00
                  2014-01-30 00:00:00-06:00   2014-01-30 11:00:00
                  2014-04-24 00:00:00-05:00   2014-04-24 10:00:00
                  2014-07-24 00:00:00-05:00   2014-07-24 10:00:00
                  2014-10-23 00:00:00-05:00   2014-10-23 10:00:00
                  2015-01-27 00:00:00-06:00   2015-01-27 11:00:00
                  

                  我認為它做了正確的事情,但我不明白輸出格式.特別是

                  I think it did the right thing, but I dont understand the output format. In particular

                  1) 為什么轉換后的列顯示為新索引?

                  1) Why do the converted cols appear as the new index?

                  2) 我知道 -06:00(最后一行)是一個小時班次,所以時間是早上 6:00,我如何檢索該信息,準確的當地時間?

                  2) I understand that -06:00 (in the last row) is an hour shift, so the time is 6:00 am, how do I retrieve that information, the exact local time?

                  所需的輸出,我想要發布的確切時間,包括與 UTC 的偏移量.當地時間 UTC 時間

                  Desired output, I want the exact time to be posted, including the offset from utc. local time utc time

                      2013-01-24 05:00:00   2013-01-24 11:00:00
                      2013-04-25 05:00:00   2013-04-25 10:00:00
                      2013-07-25 05:00:00   2013-07-25 10:00:00
                      2013-10-24 05:00:00   2013-10-24 10:00:00
                      2014-01-30 05:00:00   2014-01-30 11:00:00
                      2014-04-24 05:00:00   2014-04-24 10:00:00
                      2014-07-24 05:00:00   2014-07-24 10:00:00
                      2014-10-23 05:00:00   2014-10-23 10:00:00
                      2015-01-27 05:00:00   2015-01-27 11:00:00
                  

                  推薦答案

                  當你調用 tz.localize 你本地化索引,如果你想修改列你需要調用 dt.localize 還要添加時區偏移調用 dt.tz_convert('UTC'):

                  In [125]:
                  df['timestamp'].dt.tz_localize('utc').dt.tz_convert('US/Central')
                  
                  Out[125]:
                  index
                  2013-01-24   2013-01-24 05:00:00-06:00
                  2013-04-25   2013-04-25 05:00:00-05:00
                  2013-07-25   2013-07-25 05:00:00-05:00
                  2013-10-24   2013-10-24 05:00:00-05:00
                  2014-01-30   2014-01-30 05:00:00-06:00
                  2014-04-24   2014-04-24 05:00:00-05:00
                  2014-07-24   2014-07-24 05:00:00-05:00
                  2014-10-23   2014-10-23 05:00:00-05:00
                  2015-01-27   2015-01-27 05:00:00-06:00
                  Name: timestamp, dtype: datetime64[ns, US/Central]
                  

                  比較沒有.dt:

                  Compare without .dt:

                  In [126]:    
                  df['timestamp'].tz_localize('utc').tz_convert('US/Central')
                  Out[126]:
                  index
                  2013-01-23 18:00:00-06:00   2013-01-24 11:00:00
                  2013-04-24 19:00:00-05:00   2013-04-25 10:00:00
                  2013-07-24 19:00:00-05:00   2013-07-25 10:00:00
                  2013-10-23 19:00:00-05:00   2013-10-24 10:00:00
                  2014-01-29 18:00:00-06:00   2014-01-30 11:00:00
                  2014-04-23 19:00:00-05:00   2014-04-24 10:00:00
                  2014-07-23 19:00:00-05:00   2014-07-24 10:00:00
                  2014-10-22 19:00:00-05:00   2014-10-23 10:00:00
                  2015-01-26 18:00:00-06:00   2015-01-27 11:00:00
                  Name: timestamp, dtype: datetime64[ns]
                  

                  這篇關于 pandas 時間從UTC到本地的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How to calculate percent by row and annotate 100 percent stacked bars(如何按行計算百分比并注釋 100% 堆積條)
                  How to display percentage above grouped bar chart(如何在分組條形圖上方顯示百分比)
                  python pandas TimeStamps to local time string with daylight saving(python pandas TimeStamps到夏令時的本地時間字符串)
                  convert timestamp to datetime.datetime in pandas.Series(在 pandas.Series 中將時間戳轉換為 datetime.datetime)
                  Python List Group by Date(Python 按日期列出分組)
                  Merging and sorting log files in Python(在 Python 中合并和排序日志文件)
                • <i id='lDWEs'><tr id='lDWEs'><dt id='lDWEs'><q id='lDWEs'><span id='lDWEs'><b id='lDWEs'><form id='lDWEs'><ins id='lDWEs'></ins><ul id='lDWEs'></ul><sub id='lDWEs'></sub></form><legend id='lDWEs'></legend><bdo id='lDWEs'><pre id='lDWEs'><center id='lDWEs'></center></pre></bdo></b><th id='lDWEs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lDWEs'><tfoot id='lDWEs'></tfoot><dl id='lDWEs'><fieldset id='lDWEs'></fieldset></dl></div>

                    <legend id='lDWEs'><style id='lDWEs'><dir id='lDWEs'><q id='lDWEs'></q></dir></style></legend>
                      <tbody id='lDWEs'></tbody>
                  1. <small id='lDWEs'></small><noframes id='lDWEs'>

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

                            <tfoot id='lDWEs'></tfoot>
                          1. 主站蜘蛛池模板: av大片在线观看 | 天天干天天草 | 精品久久久久国产免费第一页 | 日日干夜夜操天天操 | 欧美一区二区黄 | 久久手机在线视频 | 在线观看国产精品一区二区 | 成人在线精品视频 | 欧美日韩精品一区 | 2022精品国偷自产免费观看 | 午夜精品久久 | 中文字幕在线三区 | 欧美日韩中文在线 | 精品欧美一区免费观看α√ | 精品视频在线播放 | 2018中文字幕第一页 | 岛国一区 | av永久 | 国产午夜三级一区二区三 | 亚洲成人精品免费 | 国产精品一区在线观看 | 亚洲欧美日韩中文字幕一区二区三区 | 亚洲一区二区三区免费观看 | 成人18亚洲xxoo | 97视频成人| 全免费a级毛片免费看视频免费下 | 亚洲区中文字幕 | 亚洲va国产日韩欧美精品色婷婷 | 在线三级网址 | 国产久 | 精品国产91乱码一区二区三区 | 日韩成人一区 | 免费久久网 | 久久精品一级 | 国产成人精品综合 | 日本精品网站 | 九一精品 | 色欧美综合 | 日本在线视频一区二区 | 国产小视频在线 | 超碰97人人人人人蜜桃 |