我正在尝试在Visual Studio 2019中配置chromedriver
我知道这很简单,但是我无法启动chromedriver
我已经使用Visual Studio 2019并在此路径中使用了chromedriver:
\ Visual Studio 2019 \ Python脚本\ Python 3.7(64位)
但是当我尝试执行此代码时:
# Count the number of True per week per ID
out = df.groupby(["ID", pd.Grouper(key='Date', freq='1W')])["Received"] \
.sum() \
.to_frame() \
.reset_index() \
.rename(columns={"Received": "Count"})
print(out)
# ID Date Count
# 0 000 2018-01-07 00:00:00+00:00 2.0
# 1 000 2018-01-14 00:00:00+00:00 2.0
# 2 000 2018-01-28 00:00:00+00:00 1.0
# 3 111 2018-01-07 00:00:00+00:00 3.0
# Fill missing date ranges
def fill_date_range(df):
dates = pd.date_range(df.Date.min(), df.Date.max(), freq="1W")
return df.set_index("Date") \
.reindex(dates)[['Count']] \
.fillna(0)
# Fill missing date range
out = out.groupby(by="ID").apply(fill_date_range) \
.reset_index() \
.rename(columns={"level_1": "Date"})
print(out)
# ID Date Count
# 0 000 2018-01-07 00:00:00+00:00 2.0
# 1 000 2018-01-14 00:00:00+00:00 2.0
# 2 000 2018-01-21 00:00:00+00:00 0.0
# 3 000 2018-01-28 00:00:00+00:00 1.0
# 4 111 2018-01-07 00:00:00+00:00 3.0
# Add date range interval as string
format = '%Y-%m-%d %H:%M:%S'
out["Date_expected"] = out.Date.dt.strftime(format) + " - " + (out.Date + pd.Timedelta(weeks=-1)).dt.strftime(format)
print(out)
# ID Date Count Date_expected
# 0 000 2018-01-07 00:00:00+00:00 2.0 2018-01-07 00:00:00 - 2017-12-31 00:00:00
# 1 000 2018-01-14 00:00:00+00:00 2.0 2018-01-14 00:00:00 - 2018-01-07 00:00:00
# 2 000 2018-01-21 00:00:00+00:00 0.0 2018-01-21 00:00:00 - 2018-01-14 00:00:00
# 3 000 2018-01-28 00:00:00+00:00 1.0 2018-01-28 00:00:00 - 2018-01-21 00:00:00
# 4 111 2018-01-07 00:00:00+00:00 3.0 2018-01-07 00:00:00 - 2017-12-31 00:00:00
我得到:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome()
driver.get("http://www.python.org")
我不知道为什么python找不到它
任何帮助将不胜感激
谢谢