pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<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="alj85ix" 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="tialwyu" 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到本地的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試將 UTC 時間轉(zhuǎn)換為本地時間.這是我之前的經(jīng)歷

                  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) 為什么轉(zhuǎn)換后的列顯示為新索引?

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

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

                  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?

                  所需的輸出,我想要發(fā)布的確切時間,包括與 UTC 的偏移量.當(dāng)?shù)貢r間 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
                  

                  推薦答案

                  當(dāng)你調(diào)用 tz.localize 你本地化索引,如果你想修改列你需要調(diào)用 dt.localize 還要添加時區(qū)偏移調(diào)用 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]
                  

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

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

                  相關(guān)文檔推薦

                  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 中將時間戳轉(zhuǎn)換為 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="hlwwzfm" 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. 主站蜘蛛池模板: 通信天线厂家_室分八木天线_对数周期天线_天线加工厂_林创天线源头厂家 | 广州监控安装公司_远程监控_安防弱电工程_无线wifi覆盖_泉威安防科技 | DDoS安全防护官网-领先的DDoS安全防护服务商 | 岛津二手液相色谱仪,岛津10A液相,安捷伦二手液相,安捷伦1100液相-杭州森尼欧科学仪器有限公司 | 辽宁资质代办_辽宁建筑资质办理_辽宁建筑资质延期升级_辽宁中杭资质代办 | 防爆鼓风机-全风-宏丰鼓风机-上海梁瑾机电设备有限公司 | 反渗透水处理设备|工业零排放|水厂设备|软化水设备|海南净水设备--海南水处理设备厂家 | 灰板纸、灰底白、硬纸板等纸品生产商-金泊纸业 | 河南包装袋厂家_河南真空袋批发价格_河南服装袋定制-恒源达包装制品 | 除甲醛公司-甲醛检测治理-杭州创绿家环保科技有限公司-室内空气净化十大品牌 | 818手游网_提供当下热门APP手游_最新手机游戏下载 | 空压机网_《压缩机》杂志| 定做大型恒温循环水浴槽-工业用不锈钢恒温水箱-大容量低温恒温水槽-常州精达仪器 | 软文世界-软文推广-软文营销-新闻稿发布-一站式软文自助发稿平台 | 丝杆升降机-不锈钢丝杆升降机-非标定制丝杆升降机厂家-山东鑫光减速机有限公司 | 越南专线物流_东莞国际物流_东南亚专线物流_行通物流 | 工业PH计|工业ph酸度计|在线PH计价格-合肥卓尔仪器仪表有限公司 济南画室培训-美术高考培训-山东艺霖艺术培训画室 | 细沙回收机-尾矿干排脱水筛设备-泥石分离机-建筑垃圾分拣机厂家-青州冠诚重工机械有限公司 | 冷凝水循环试验箱-冷凝水试验箱-可编程高低温试验箱厂家-上海巨为(www.juweigroup.com) | 假肢-假肢价格-假肢厂家-河南假肢-郑州市力康假肢矫形器有限公司 | 仿古瓦,仿古金属瓦,铝瓦,铜瓦,铝合金瓦-西安东申景观艺术工程有限公司 | 安徽净化工程设计_无尘净化车间工程_合肥净化实验室_安徽创世环境科技有限公司 | 苏州注册公司_苏州代理记账_苏州工商注册_苏州代办公司-恒佳财税 | 2025世界机器人大会_IC China_半导体展_集成电路博览会_智能制造展览网 | 手术室净化厂家_成都实验室装修公司_无尘车间施工单位_洁净室工程建设团队-四川华锐16年行业经验 | 自动焊锡机_点胶机_螺丝机-锐驰机器人 | 亮点云建站-网站建设制作平台| 塑钢课桌椅、学生课桌椅、课桌椅厂家-学仕教育设备首页 | 河南中专学校|职高|技校招生-河南中职中专网 | 三价铬_环保铬_环保电镀_东莞共盈新材料贸易有限公司 | 棉柔巾代加工_洗脸巾oem_一次性毛巾_浴巾生产厂家-杭州禾壹卫品科技有限公司 | 荣事达手推洗地机_洗地机厂家_驾驶式扫地机_工业清洁设备 | 酶联免疫分析仪-多管旋涡混合仪|混合器-莱普特科学仪器(北京)有限公司 | 台式恒温摇床价格_大容量恒温摇床厂家-上海量壹科学仪器有限公司 | 艾乐贝拉细胞研究中心 | 国家组织工程种子细胞库华南分库 | ph计,实验室ph计,台式ph计,实验室酸度计,台式酸度计 | 磁力抛光研磨机_超声波清洗机厂家_去毛刺设备-中锐达数控 | 合肥钣金加工-安徽激光切割加工-机箱机柜加工厂家-合肥通快 | 杭州营业执照代办-公司变更价格-许可证办理流程_杭州福道财务管理咨询有限公司 | 杭州可当科技有限公司—流量卡_随身WiFi_AI摄像头一站式解决方案 | 中空玻璃生产线,玻璃加工设备,全自动封胶线,铝条折弯机,双组份打胶机,丁基胶/卧式/立式全自动涂布机,玻璃设备-山东昌盛数控设备有限公司 |