我只是实现了一个简单的机器人,该机器人应该将一些照片和视频发送给我chat_id。好吧,我正在使用python,这是脚本
import sys
import time
import random
import datetime
import telepot
def handle(msg):
chat_id = msg['chat']['id']
command = msg['text']
print 'Got command: %s' % command
if command == 'command1':
bot.sendMessage(chat_id, *******)
elif command == 'command2':
bot.sendMessage(chat_id, ******)
elif command == 'photo':
bot.sendPhoto(...)
bot = telepot.Bot('*** INSERT TOKEN ***')
bot.message_loop(handle)
print 'I am listening ...'
while 1:
time.sleep(10)
Run Code Online (Sandbox Code Playgroud)
在这一行中,bot.sendphoto我将插入chat_id图像的路径和,但是什么也没有发生。
我哪里错了?
谢谢
我不明白 PCA 的一点。PCA 返回使每个特征的方差最大化的方向?我的意思是,它将为我们原始空间的每个特征返回一个组件,并且只有k最大的组件将用作新子空间的轴,对吗?所以实际上,如果我在 50-D 中并且 49 个特征具有很强的方差,我可以传递到 49-D 空间吗?当然,我说的是简单的英语,没有正式或技术性的内容。
谢谢
我对 MapReduce 框架很困惑。我从不同的来源读到了这方面的内容,感到很困惑。顺便说一句,这是我对 MapReduce 作业的想法
1. Map()-->emit <key,value>
2. Partitioner (OPTIONAL) --> divide
intermediate output from mapper and assign them to different
reducers
3. Shuffle phase used to make: <key,listofvalues>
4. Combiner, component used like a minireducer wich perform some
operations on datas and then pass those data to the reducer.
Combiner is on local not HDFS, saving space and time.
5. Reducer, get the data from the combiner, perform further
operation(probably the same as the combiner) then release the …Run Code Online (Sandbox Code Playgroud) combiners ×1
hadoop ×1
mapreduce ×1
partitioner ×1
pca ×1
python ×1
telegram-bot ×1
telepot ×1