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

    1. <tfoot id='0lVrU'></tfoot>

        <small id='0lVrU'></small><noframes id='0lVrU'>

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

        Pandas Timedelta 以天為單位

        Pandas Timedelta in Days(Pandas Timedelta 以天為單位)

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

        <tfoot id='Yckxl'></tfoot>
        <legend id='Yckxl'><style id='Yckxl'><dir id='Yckxl'><q id='Yckxl'></q></dir></style></legend>

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

                1. 本文介紹了Pandas Timedelta 以天為單位的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在 pandas 中有一個名為munged_data"的數據框,其中包含兩列entry_date"和dob",我已使用 pd.to_timestamp 將其轉換為時間戳.我試圖弄清楚如何根據時間計算人的年齡'entry_date' 和 'dob' 之間的區別,要做到這一點,我需要得到兩列之間的天數差異(這樣我就可以像 round(days/365.25) 一樣做一些事情.我似乎無法找到一種使用矢量化操作的方法.當我執行 munged_data.entry_date-munged_data.dob 時,我得到以下信息:

                  I have a dataframe in pandas called 'munged_data' with two columns 'entry_date' and 'dob' which i have converted to Timestamps using pd.to_timestamp.I am trying to figure out how to calculate ages of people based on the time difference between 'entry_date' and 'dob' and to do this i need to get the difference in days between the two columns ( so that i can then do somehting like round(days/365.25). I do not seem to be able to find a way to do this using a vectorized operation. When I do munged_data.entry_date-munged_data.dob i get the following :

                  internal_quote_id
                  2                    15685977 days, 23:54:30.457856
                  3                    11651985 days, 23:49:15.359744
                  4                     9491988 days, 23:39:55.621376
                  7                     11907004 days, 0:10:30.196224
                  9                    15282164 days, 23:30:30.196224
                  15                  15282227 days, 23:50:40.261632  
                  

                  但是我似乎無法將天數提取為整數,以便我可以繼續計算.任何幫助表示贊賞.

                  However i do not seem to be able to extract the days as an integer so that i can continue with my calculation. Any help appreciated.

                  推薦答案

                  你需要 0.11 這個(0.11rc1 已經出來了,下周最后的問題)

                  You need 0.11 for this (0.11rc1 is out, final prob next week)

                  In [9]: df = DataFrame([ Timestamp('20010101'), Timestamp('20040601') ])
                  
                  In [10]: df
                  Out[10]: 
                                      0
                  0 2001-01-01 00:00:00
                  1 2004-06-01 00:00:00
                  
                  In [11]: df = DataFrame([ Timestamp('20010101'), 
                                            Timestamp('20040601') ],columns=['age'])
                  
                  In [12]: df
                  Out[12]: 
                                    age
                  0 2001-01-01 00:00:00
                  1 2004-06-01 00:00:00
                  
                  In [13]: df['today'] = Timestamp('20130419')
                  
                  In [14]: df['diff'] = df['today']-df['age']
                  
                  In [16]: df['years'] = df['diff'].apply(lambda x: float(x.item().days)/365)
                  
                  In [17]: df
                  Out[17]: 
                                    age               today                diff      years
                  0 2001-01-01 00:00:00 2013-04-19 00:00:00 4491 days, 00:00:00  12.304110
                  1 2004-06-01 00:00:00 2013-04-19 00:00:00 3244 days, 00:00:00   8.887671
                  

                  最后你需要這個奇怪的應用程序,因為還沒有完全支持 timedelta64[ns] 標量(例如,我們現在如何使用時間戳來處理 datetime64[ns],在 0.12 中)

                  You need this odd apply at the end because not yet full support for timedelta64[ns] scalars (e.g. like how we use Timestamps now for datetime64[ns], coming in 0.12)

                  這篇關于Pandas Timedelta 以天為單位的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 包)
                  • <legend id='KtGpI'><style id='KtGpI'><dir id='KtGpI'><q id='KtGpI'></q></dir></style></legend>

                      • <bdo id='KtGpI'></bdo><ul id='KtGpI'></ul>

                          <tbody id='KtGpI'></tbody>

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

                            <tfoot id='KtGpI'></tfoot>
                          2. 主站蜘蛛池模板: 日本黄色免费大片 | 麻豆av在线免费观看 | 日韩高清成人 | 巨大荫蒂视频欧美另类大 | 亚洲 一区 | 这里有精品| 久久精品视频免费观看 | 精品欧美一区二区精品久久久 | 欧美成人精品一区二区三区 | av第一页 | 日韩一区二区三区av | 久久久久久久久久久高潮一区二区 | 国产一区二区电影网 | 亚洲国产精品日本 | 美女在线视频一区二区三区 | 中文av电影 | 热99| 一区精品视频 | 911精品美国片911久久久 | 中文字幕在线剧情 | 日韩av在线免费 | 亚洲精品视频在线观看视频 | 午夜欧美一区二区三区在线播放 | 国产成人精品一区二区三区四区 | 97人人超碰 | 另类 综合 日韩 欧美 亚洲 | 欧美一区二区三区四区五区无卡码 | 三级黄色片在线播放 | 玖玖玖av | 91在线视频播放 | 国产精品精品 | 亚欧精品 | 欧美日韩高清 | 91综合在线视频 | 久久在线免费 | www.99久久.com | 国产精品视频免费观看 | 国产亚洲欧美在线 | 中文一区二区 | 国产亚洲区| www.99热|