![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python解决的问题
luguanyou
这个作者很懒,什么都没留下…
展开
-
Python3 按行读取txt
list=[]for line in open("test.txt"): print(line[:-1].split(" ")[1:]) for box in line[:-1].split(" ")[1:]: list.append(box.split(",")[-1]) print(box.split(",")[-1])import arraylist0=[]list1=[]list2=[]list3=[]list4=[]for i i.原创 2020-12-28 19:24:35 · 1025 阅读 · 0 评论 -
python 怎样把一个数组类型数据保存为csv文件
有时候做完一个案例的分析,模型做好了,最后想把预测的结果保存为CSV文件。这个预测的结果一般是n行1列的一个数列,我们最后就是想把预测结果保存下来。 submission = clf.predict(credit_test)#submission是我的预测结果,是一个5000*1的列向量submission = pd.DataFrame({'RISK':submission})#必须把这个s...原创 2018-06-06 16:56:02 · 25899 阅读 · 0 评论 -
IndentationError: unexpected indent 空格和tap键混用造成的错误
解决方案:用sublime preferences--->setting然后添加"draw_white_space":"all"就可以轻易看出哪里用了tap键 哪里用了空格原创 2018-09-11 16:12:07 · 411 阅读 · 0 评论 -
django def __str__(self):报错
本人用的是python3,看教程用def __str__(self):没错,还来尝试用了一下def __unicode__(self):,居然问题解决了。原创 2018-10-30 14:50:06 · 2404 阅读 · 0 评论