我有以下导入错误
"ImportError:没有名为scheduler的模块"
当我运行以下python脚本时:
"""
Demonstrates how to use the blocking scheduler to schedule a job that execute$
"""
from datetime import datetime
import os
from apscheduler.scheduler import BlockingScheduler
def tick():
print('Tick! The time is: %s' % datetime.now())
if __name__ == '__main__':
scheduler = BlockingScheduler()
scheduler.add_job(tick, 'interval', seconds=3)
print('Press Ctrl+{0} to exit'.format('Break' if os.name == 'nt' else 'C'$
try:
scheduler.start()
except (KeyboardInterrupt, SystemExit):
pass
Run Code Online (Sandbox Code Playgroud)
我已经安装了APS调度程序:sudo pip install apscheduler
我也升级了使用:sudo pip install apscheduler --upgrade还使用"sudo apt-get install update && sudo apt-get upgrade"升级了我的系统
我想在将pandas data-frame转换为html表时删除索引.原型如下:
import pandas as pd
import numpy as np
df= pd.DataFrame({'list':np.random.rand(100)})
html_table = df.to_html()
Run Code Online (Sandbox Code Playgroud)
在html表中我不想显示索引.
我正在尝试使用 Mongo 执行聚合操作,如下所示:
db.inbound_documents.aggregate([{"$match":
{"$completed_on":
{"$gte":'2018-05-19 00:00:00',
"$lte":'2017-05-19 00:00:00'}}},
{"$group":
{"_id":"$completed_by","total":{"$sum":1}}}])
Run Code Online (Sandbox Code Playgroud)
Completed_on 在模式中可用,但我仍然不明白为什么它会导致该错误。