我有数据
date url
2016-07-01 11:43:09 https://www.youtube.com/api/stats/ads?ver=2&ns=1&event=2&device=5&content_v=cmqQy3v8KvM&el=detailpage&ei=bld2V--RJoWHW4OQlbAN&devicever=11.23&format=2_2_1&break_type=1&conn=3&cpn=ifKDc6HI6TsnATCH&lact=8504&m_pos=0&mt=0&p_h=360&p_w=640&rwt=1467373422397%2C1467373422396&sdkv=i.11.23&slot_pos=0&vis=0&wt=1467373429902&ad_cpn=0j9BVNwMa82ofEZg&ad_id=%2C108802074909&ad_len=16000&ad_mt=149&ad_sys=YT%3ADoubleClick%2CAdSense&ad_v=L5FSoYGhNzA&aqi=
2016-07-01 11:43:10 https://www.youtube.com/api/stats/ads?ver=2&ns=1&event=11&device=5&content_v=cmqQy3v8KvM&el=detailpage&ei=bld2V--RJoWHW4OQlbAN&devicever=11.23&format=2_2_1&break_type=1&conn=3&cpn=ifKDc6HI6TsnATCH&lact=10591&m_pos=0&mt=0&p_h=360&p_w=640&rwt=1467373422397%2C1467373422396&sdkv=i.11.23&slot_pos=0&vis=0&wt=1467373431989&ad_cpn=0j9BVNwMa82ofEZg&ad_id=%2C108802074909&ad_len=16000&ad_mt=2190&ad_sys=YT%3ADoubleClick%2CAdSense&ad_v=L5FSoYGhNzA&aqi=
2016-07-01 11:43:11 https://s.youtube.com/api/stats/watchtime?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cos=iOS&c=ios&cl=126273513&adformat=2_2_1&rt=9.86&ei=b1d2V-D3A8SJWfqIsjA&state=playing&conn=3&cver=11.23.9&autoplay=1&cmodel=iPhone5%2C1&st=0.00&fmt=230&el=adunit&len=16&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=10873&rtn=20.00&uga=f22&plid=AAU2kX-jl0o9LaFL&cnetwork=wifi&cplatform=mobile&ns=yt&docid=L5FSoYGhNzA&cplayer=NATIVE_MEDIA_PLAYER&rti=9.86&et=2.40&of=f_cHrcPu1wZuG5dS5030Gw&ver=2&cpn=0j9BVNwMa82ofEZg&vm=CAEQAA
2016-07-01 11:43:21 https://s.youtube.com/api/stats/watchtime?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cos=iOS&c=ios&cl=126273513&adformat=2_2_1&rt=20.00&ei=b1d2V-D3A8SJWfqIsjA&state=playing&conn=3&cver=11.23.9&autoplay=1&cmodel=iPhone5%2C1&st=2.40&fmt=230&el=adunit&len=16&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=21009&rtn=30.00&uga=f22&plid=AAU2kX-jl0o9LaFL&cnetwork=wifi&cplatform=mobile&ns=yt&docid=L5FSoYGhNzA&cplayer=NATIVE_MEDIA_PLAYER&rti=20.00&et=12.60&of=f_cHrcPu1wZuG5dS5030Gw&ver=2&cpn=0j9BVNwMa82ofEZg&vm=CAEQAA
2016-07-01 11:43:22 https://s.youtube.com/api/stats/delayplay?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cmt=14.00&cos=iOS&c=ios&cl=126273513&adformat=2_2_1&rt=21.39&ei=b1d2V-D3A8SJWfqIsjA&mos=0&cver=11.23.9&conn=3&autoplay=1&cmodel=iPhone5%2C1&fmt=230&el=adunit&len=16&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=22401&uga=f22&plid=AAU2kX-jl0o9LaFL&cnetwork=wifi&cplatform=mobile&volume=0&ns=yt&docid=L5FSoYGhNzA&cplayer=NATIVE_MEDIA_PLAYER&delay=14&of=f_cHrcPu1wZuG5dS5030Gw&ver=2&cpn=0j9BVNwMa82ofEZg&vm=CAEQAA
2016-07-01 11:43:23 https://s.youtube.com/api/stats/watchtime?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cos=iOS&c=ios&cl=126273513&adformat=2_2_1&rt=22.43&ei=b1d2V-D3A8SJWfqIsjA&state=paused&conn=3&cver=11.23.9&autoplay=1&cmodel=iPhone5%2C1&st=12.60&fmt=230&el=adunit&len=16&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=23439&uga=f22&plid=AAU2kX-jl0o9LaFL&cnetwork=wifi&cplatform=mobile&final=1&ns=yt&docid=L5FSoYGhNzA&cplayer=NATIVE_MEDIA_PLAYER&rti=30.00&of=f_cHrcPu1wZuG5dS5030Gw&et=15.00&ver=2&cpn=0j9BVNwMa82ofEZg&vm=CAEQAA
2016-07-01 11:43:23 https://www.youtube.com/api/stats/ads?ver=2&ns=1&event=3&device=5&content_v=cmqQy3v8KvM&el=detailpage&ei=bld2V--RJoWHW4OQlbAN&devicever=11.23&format=2_2_1&break_type=1&conn=3&cpn=ifKDc6HI6TsnATCH&lact=23471&m_pos=0&mt=0&p_h=360&p_w=640&rwt=1467373422397%2C1467373422396&sdkv=i.11.23&slot_pos=0&vis=0&wt=1467373444869&ad_cpn=0j9BVNwMa82ofEZg&ad_id=%2C108802074909&ad_len=16000&ad_mt=14999&ad_sys=YT%3ADoubleClick%2CAdSense&ad_v=L5FSoYGhNzA&aqi=
2016-07-01 11:43:23 https://www.youtube.com/api/stats/ads?ver=2&ns=1&event=8&device=5&content_v=cmqQy3v8KvM&el=detailpage&ei=bld2V--RJoWHW4OQlbAN&devicever=11.23&format=2_2_1&break_type=1&conn=3&cpn=ifKDc6HI6TsnATCH&lact=23444&m_pos=0&mt=0&p_h=360&p_w=640&rwt=1467373422397%2C1467373422396&sdkv=i.11.23&slot_pos=0&vis=0&wt=1467373444842&ad_cpn=0j9BVNwMa82ofEZg&ad_id=%2C108802074909&ad_len=16000&ad_mt=14999&ad_sys=YT%3ADoubleClick%2CAdSense&ad_v=L5FSoYGhNzA&aqi=
2016-07-01 11:43:24 https://www.youtube-nocookie.com/api/ads/trueview_redirect?ei=CLXn-vyX0s0CFY2L7QodeBAIaQ&conv=https://www.googleadservices.com/pagead/aclk%3Fsa%3DL%26ai%3DCcoLPbld2V7X4MY2Xtgf4oKDIBtzNsoRFndLvqJUDrQIQASDj-5MDYPXa6oP8DqAB4_i1vQPIAQXgAgCoAwGYBAWqBLwBT9DAK9ezWGtRChu3Xx5jElt-O6Rii8byOJRLm6fVMSWfH1PBo7O0QnGwD7JdBTY_znEQdlyOShODR2BiOizF-mEcGC57OhoWUeoHbghInjOjWZ6IoGy-Cf0i3laAKq-HJY7qfEqKECwebFGsGU54E6eTXQx8pdTcfnJoNrHhOXwiAzk1dIaMIK2goB6y7zBmqB3AUCzF1EBc-QRQaHvcT9J-ZtErk5vSMAgNYR5SIpdJt5EvG2RakBpdFNbgBAGIBbX807oBkgUGCAYQARgBkgUECAYYA4gGAZAGAaAGHNgGAoAHhYfKQpgHAqgHpr4b0AcB2AcB-gcTY29tLm5lb25mdW4uY2F0YWxvZ5IIC0w1RlNvWUdoTnpB2BMI%26num%3D1%26cid%3DCAASEuRo3O3X8NekDqfXrthL_Mh9kQ%26sig%3DAOD64_0vCVa3wVIQ1A-mHgSefPqZn95D7w%26client%3Dca-pub-6219811747049371%26adurl%3Dhttps://itunes.apple.com/kr/app/episode-choose-your-story/id656971078%253Fmt%253D8%2526uo%253D4%26label%3Dvideo_engaged_view%26clp%3D1
2016-07-01 11:43:28 http://gsp1.apple.com/pep/gcc
2016-07-01 11:43:29 https://s.youtube.com/api/stats/qoe?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&afs=0.061%3A234%3B%3A%3Ai%2C7.827%3A233%3B%3A234%3Aa&cos=iOS&c=ios&cl=126273513&adformat=2_2_1&snd=0.005%3A0&ei=b1d2V-D3A8SJWfqIsjA&cver=11.23.9&conn=0.004%3A3&view=0.061%3A320%3A180%3A2%2C7.827%3A320%3A180%3A2&cmodel=iPhone5%2C1&fmt=269&ad_break_type=1&event=streamingstats&vnd=0.005%3A0&cbrver=11.23.9&vis=0.005%3A0&cosver=9.3.2&vps=0.000%3AN%2C7.365%3AB%2C7.406%3APL%2C22.416%3AEN%2C27.610%3AN&cbr=com.google.ios.youtube&bwe=0.061%3A234585&error=7.309%3Aios.cm.-12318%3A14.999%3Aec.cm.-12318%3Bshost.r19---sn-q0c7dn7s.googlevideo.com&bwm=27.599%3A409073%3A15.705&plid=AAU2kX-jl0o9LaFL&cnetwork=wifi&cplatform=mobile&vfs=0.061%3A230%3B%3A230%3A%3Ai%2C7.827%3A269%3B%3A230%3A230%3Aa&ns=yt&docid=L5FSoYGhNzA&bat=0.008%3A0.31%3A0&bh=7.365%3A0.6%2C7.406%3A0.6%2C7.827%3A0.0&cpn=0j9BVNwMa82ofEZg
2016-07-01 11:43:30 https://s.youtube.com/api/stats/playback?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cmt=0.00&cos=iOS&c=ios&cl=126273513&ei=bld2V--RJoWHW4OQlbAN&rt=1.90&feature=g-high-cpw&mos=0&cver=11.23.9&conn=3&cmodel=iPhone5%2C1&fmt=269&el=detailpage&len=460&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=30582&rtn=10.00&uga=f22&plid=AAU2kX-iPbMH2ZNZ&cnetwork=wifi&cplatform=mobile&volume=0&ns=yt&docid=cmqQy3v8KvM&cplayer=NATIVE_MEDIA_PLAYER&of=W2b1EmnEal5D4FOkC0QrpA&ver=2&cpn=ifKDc6HI6TsnATCH&vm=CAEQAQ
2016-07-01 11:43:38 https://s.youtube.com/api/stats/watchtime?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cos=iOS&c=ios&cl=126273513&ei=bld2V--RJoWHW4OQlbAN&rt=10.00&feature=g-high-cpw&state=playing&conn=3&cver=11.23.9&st=0.00&cmodel=iPhone5%2C1&fmt=269&el=detailpage&len=460&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=38679&rtn=20.00&uga=f22&plid=AAU2kX-iPbMH2ZNZ&cnetwork=wifi&cplatform=mobile&ns=yt&docid=cmqQy3v8KvM&cplayer=NATIVE_MEDIA_PLAYER&rti=10.00&et=8.00&of=W2b1EmnEal5D4FOkC0QrpA&ver=2&cpn=ifKDc6HI6TsnATCH&vm=CAEQAQ
2016-07-01 11:43:48 https://s.youtube.com/api/stats/watchtime?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cos=iOS&c=ios&cl=126273513&ei=bld2V--RJoWHW4OQlbAN&rt=20.00&feature=g-high-cpw&state=playing&conn=3&cver=11.23.9&st=8.00&cmodel=iPhone5%2C1&fmt=269&el=detailpage&len=460&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=48682&rtn=30.00&uga=f22&plid=AAU2kX-iPbMH2ZNZ&cnetwork=wifi&cplatform=mobile&ns=yt&docid=cmqQy3v8KvM&cplayer=NATIVE_MEDIA_PLAYER&rti=20.00&et=18.00&of=W2b1EmnEal5D4FOkC0QrpA&ver=2&cpn=ifKDc6HI6TsnATCH&vm=CAEQAQ
2016-07-01 11:43:58 https://s.youtube.com/api/stats/watchtime?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cos=iOS&c=ios&cl=126273513&ei=bld2V--RJoWHW4OQlbAN&rt=30.00&feature=g-high-cpw&state=playing&conn=3&cver=11.23.9&st=18.00&cmodel=iPhone5%2C1&fmt=269&el=detailpage&len=460&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=5981&rtn=330.00&uga=f22&plid=AAU2kX-iPbMH2ZNZ&cnetwork=wifi&cplatform=mobile&ns=yt&docid=cmqQy3v8KvM&cplayer=NATIVE_MEDIA_PLAYER&rti=30.00&et=28.00&of=W2b1EmnEal5D4FOkC0QrpA&ver=2&cpn=ifKDc6HI6TsnATCH&vm=CAEQAQ
2016-07-01 11:44:27 http://gsp1.apple.com/pep/gcc
2016-07-01 11:44:28 https://s.youtube.com/api/stats/watchtime?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cos=iOS&c=ios&cl=126273513&ei=bld2V--RJoWHW4OQlbAN&rt=58.04&feature=g-high-cpw&state=playing&conn=3%2C3&cver=11.23.9&st=28.00%2C30.89&cmodel=iPhone5%2C1&fmt=269&el=detailpage&len=460&cbrver=11.23.9&vis=0%2C1&cosver=9.3.2&cbr=com.google.ios.youtube&lact=123&uga=f22&plid=AAU2kX-iPbMH2ZNZ&cnetwork=wifi&cplatform=mobile&final=1&ns=yt&docid=cmqQy3v8KvM&cplayer=NATIVE_MEDIA_PLAYER&rti=330.00&et=30.89%2C56.05&of=W2b1EmnEal5D4FOkC0QrpA&ver=2&cpn=ifKDc6HI6TsnATCH&vm=CAEQAQ
2016-07-01 11:44:29 https://s.youtube.com/api/stats/qoe?cmodel=iPhone5%2C1&bwe=0.067%3A43756&c=ios&ns=yt&conn=0.004%3A3&bat=0.014%3A0.31%3A0&plid=AAU2kX-iPbMH2ZNZ&cplatform=mobile&vfs=0.067%3A269%3B%3A230%3A%3Ai%2C1.847%3A230%3B%3A230%3A269%3Aa%2C7.053%3A231%3B%3A230%3A230%3Aa%2C32.719%3A230%3B%3A230%3A231%3Aa%2C58.037%3A229%3B%3A229%3A230%3Aa&vnd=0.004%3A0&cbrver=11.23.9&event=streamingstats&cos=iOS&vps=0.000%3AN%2C1.551%3AB%2C1.558%3APL%2C58.088%3AN&fmt=229&afs=0.067%3A233%3B%3A%3Ai%2C1.847%3A234%3B%3A233%3Aa%2C7.053%3A234%3B%3A234%3Aa%2C32.719%3A234%3B%3A234%3Aa%2C58.037%3A234%3B%3A234%3Aa&cl=126273513&fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&vis=0.004%3A0%2C32.777%3A1%2C57.932%3A0&cnetwork=wifi&ad_break_type=0&cpn=ifKDc6HI6TsnATCH&cosver=9.3.2&snd=0.004%3A0&docid=cmqQy3v8KvM&feature=g-high-cpw&cbr=com.google.ios.youtube&view=0.067%3A320%3A180%3A2%2C1.847%3A320%3A180%3A2%2C7.053%3A320%3A180%3A2%2C32.719%3A320%3A180%3A2%2C58.037%3A160%3A90%3A2&ei=bld2V--RJoWHW4OQlbAN&bh=1.551%3A9.9%2C1.558%3A9.9%2C1.847%3A131.9%2C7.053%3A131.9%2C32.719%3A239.1%2C58.037%3A239.1&bwm=30.068%3A16561269%3A28.361%2C58.040%3A8002237%3A16.847&cver=11.23.9
2016-07-01 11:44:30 https://s.youtube.com/api/stats/playback?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cmt=0.05&cos=iOS&c=ios&cl=126273513&ei=xVd2V5XSDdTBWq7bmfgM&rt=2.27&feature=g-high-fre&mos=0&cver=11.23.9&conn=3&cmodel=iPhone5%2C1&fmt=230&el=detailpage&len=797&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=2837&rtn=9.95&uga=f22&plid=AAU2kYTHEDgoKDTG&cnetwork=wifi&cplatform=mobile&volume=0&ns=yt&docid=Aos0nfEhKuc&cplayer=NATIVE_MEDIA_PLAYER&of=d5ItTIpV6GrtfdKsxzheKg&ver=2&cpn=naUsnc0vtv6oMP5C&vm=CAEQAQ
2016-07-01 11:44:37 https://s.youtube.com/api/stats/watchtime?fexp=9416891%2C9419451%2C9422596%2C9428269%2C9428398%2C9428492%2C9431012%2C9431674%2C9432067%2C9433096%2C9433380%2C9433946%2C9434803%2C9435467%2C9435526%2C9435876%2C9436275%2C9436302%2C9436484%2C9437553%2C9437967%2C9438327%2C9438699%2C9439362%2C9439652%2C9439816%2C9440876&cos=iOS&c=ios&cl=126273513&ei=xVd2V5XSDdTBWq7bmfgM&rt=9.96&feature=g-high-fre&state=playing&conn=3&cver=11.23.9&st=0.00&cmodel=iPhone5%2C1&fmt=230&el=detailpage&len=797&cbrver=11.23.9&vis=0&cosver=9.3.2&cbr=com.google.ios.youtube&lact=10526&rtn=20.00&uga=f22&plid=AAU2kYTHEDgoKDTG&cnetwork=wifi&cplatform=mobile&ns=yt&docid=Aos0nfEhKuc&cplayer=NATIVE_MEDIA_PLAYER&rti=9.95&et=7.60&of=d5ItTIpV6GrtfdKsxzheKg&ver=2&cpn=naUsnc0vtv6oMP5C&vm=CAEQAQ
当我在url.str.contents("cmqQy3v8KvM")
首次和最后一次看到url
时,我需要找到日期间隔(diffdate)。
但是我有其他人ID,我怎样才能确定所有id
?
答案 0 :(得分:1)
您可以先过滤df
,然后按iat
选择的第一个和最后一个值获得差异:
L = ['AAU2kYTHEDgoKDTG', 'cmqQy3v8KvM']
for id in L:
df1 = df.ix[df.url.str.contains(id), 'date']
print (df1.iat[-1] - df1.iat[0])
0 days 00:00:07
0 days 00:01:20