小编tho*_*3ch的帖子

如何根据给定的日期从 DatetimeIndex 获取索引计数?

我有一个 DataFrame,它的索引是 DatetimeIndex 类型,如下所示:

DatetimeIndex(
    ['2003-10-17', '2003-10-21', '2003-10-22', '2003-10-23',
      '2003-10-24', '2003-10-27', '2003-10-28', '2003-10-29',
      '2003-10-30', '2003-10-31',
       ...
      '2017-08-04', '2017-08-07', '2017-08-08', '2017-08-09',
      '2017-08-10', '2017-08-11', '2017-08-14', '2017-08-15',
      '2017-08-16', '2017-08-17'
    ],
    dtype='datetime64[ns, UTC]', name=u'DATE', length=3482, freq=None
)
Run Code Online (Sandbox Code Playgroud)

2017-08-04我想知道如何获取例如索引计数的位置。

python-3.x

5
推荐指数
1
解决办法
4722
查看次数

How to download the PDF by using Selenium Module (FireFox) in Python 3

I want to download a PDF which is from an Online-Magazin. In order to open it, must log in first. Then open the PDF and download it.

The following is my code. It can login to the page and the PDF can also be open. But the PDF can not be downloaded since I am not sure how to simulate the click on Save. I use FireFox.

import os, time
from selenium import webdriver
from bs4 import BeautifulSoup

# Use …
Run Code Online (Sandbox Code Playgroud)

firefox selenium python-3.x

2
推荐指数
1
解决办法
1051
查看次数

标签 统计

python-3.x ×2

firefox ×1

selenium ×1