灵魂xl
发表于 2018-2-27 20:25:39
666
灵魂xl
发表于 2018-2-27 20:26:43
666,看看
wuguzl
发表于 2018-2-27 20:42:40
very good
dacc
发表于 2018-2-27 21:13:06
看一下
OldHunter
发表于 2018-2-27 21:46:37
有意思,学习学习。
Yueeeeee
发表于 2018-2-27 22:25:22
来看看
Serene。
发表于 2018-2-28 01:20:56
看看大神
qwc3000
发表于 2018-2-28 06:48:22
我是来学习的
sirliu
发表于 2018-2-28 07:23:29
学习下,是不是只针对某类操作呢?
sirliu
发表于 2018-2-28 07:27:50
看完了,小白看不明白
腿鱼
发表于 2018-2-28 08:55:26
123
sirliu
发表于 2018-2-28 17:00:40
字符串处理不行
import datetime
from numba import jit
@jit
def bj():
start = datetime.datetime.now()
file0 = 'ic.csv'
file1 = 'ga.csv'
ic = open(file0)
ga = open(file1)
count_ga = 0
count_ic = 0
for ga_line in ga:
count_ga += 1
ga_str= ga_line.split(',') #获取GA第2列的值
# gaget = ga_line.split(',')
if ga_str == "": #如果GA里的值为空,跳出本次循环不执行下面的for语句
print('GA第 ' +str(count_ga)+' 行为空跳过')
continue
else:
count_ic = 0
ic.seek(0,0)
for ic_line in ic:
count_ic += 1
# print('正在用GA第 ' +str(count_ga)+' 行与',end = "")
# print('IC第 ' +str(count_ic)+' 行进行匹配')
try:
ic_str = ic_line.split(',')#获取IC第6列的值
if ga_str in ic_str: #如果IC第6列包含GA第2列中的值,则打印出各自的行号,并中断IC读取的循环,进入读取ga的下次循环
# ic.write(ic_line.replace('\n',gaget+'\n')
# print('★★★★GA第%d行与IC第%d行匹配★★★★'%(count_ga,count_ic))
# print(' GA: '+ga_str)
# print(' IC: '+ic_str)
# print('已经将'+gaget+'追加')
break
except IndexError:
print(str(count_ic))
ic.close
ga.close
end = datetime.datetime.now()
print (end-start)
bj()
错误信息:
Traceback (most recent call last):
File "d:\刘政\巡查平台开发\百度贴吧爬虫\testcsv.py", line 45, in <module>
bj()
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\dispatcher.py", line 307, in _compile_for_args
return self.compile(tuple(argtypes))
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\dispatcher.py", line 579, in compile
cres = self._compiler.compile(args, return_type)
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\dispatcher.py", line 80, in compile
flags=flags, locals=self.locals)
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\compiler.py", line 766, in compile_extra
return pipeline.compile_extra(func)
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\compiler.py", line 362, in compile_extra
return self._compile_bytecode()
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\compiler.py", line 725, in _compile_bytecode
return self._compile_core()
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\compiler.py", line 712, in _compile_core
res = pm.run(self.status)
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\compiler.py", line 248, in run
raise patched_exception
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\compiler.py", line 240, in run
stage()
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\compiler.py", line 376, in stage_analyze_bytecode
func_ir = translate_stage(self.func_id, self.bc)
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\compiler.py", line 830, in translate_stage
return interp.interpret(bytecode)
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\interpreter.py", line 92, in interpret
self.cfa.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\numba\controlflow.py", line 515, in run
assert not inst.is_jump, inst
AssertionError: Failed at object (analyzing bytecode)
SETUP_EXCEPT(arg=28, lineno=30)
我是谁哇
发表于 2018-3-1 00:24:30
what is that
KING_NJ
发表于 2018-3-2 11:32:46
666
ydchang
发表于 2018-3-2 12:59:46
看看
青霉素毛豆
发表于 2018-3-2 13:56:42
看看是什么代码
淫令天下
发表于 2018-3-2 14:46:47
取经取经
a2315513381
发表于 2018-3-2 15:32:27
看起来很厉害的样子!
叶小风
发表于 2018-3-2 16:08:22
看看
Python26
发表于 2018-3-3 07:18:12
学到知识了,高兴