Mr·Li博客

Happiness First!

无所谓,我会出手

  • 我曾道貌岸然,却经你似水流年~

    11 2020 档案

    摘要:bson.errors.InvalidDocument: documents must have only string keys, key was <class 'type'>最近在弄MongoDB查询数据,试着用python实现查询数据,不容易上手,在这里总结一下报的错误 from pymongo import MongoClient url= 'mongodb://user:password@ip:port' class PyMongoDemo(object): de 阅读全文
    posted @ 2020-11-30 17:57 Mr·Li程序员 阅读(1625) 评论(0) 推荐(0) 编辑
    摘要:代码实现post请求往接口提交数据需求:往接口上传数据 没下载postman,所以直接在代码行里执行测试接口是否可用 import grequests # 调用接口通知分配完订单的组的信息 url= 'http://0.0.0.0:5000/' data = {'groupId': 1, 'date': '2020'} rs = [ 阅读全文
    posted @ 2020-11-27 16:21 Mr·Li程序员 阅读(381) 评论(0) 推荐(0) 编辑
    摘要:接口 接收post请求和get请求需求:接收post和get请求的数据 def get_data(): # 默认返回内容 return_dict = {'return_code': '200', 'return_info': '处理成功', 'result': False} # 判断传入的json数据是否为空 if request. 阅读全文
    posted @ 2020-11-27 16:18 Mr·Li程序员 阅读(702) 评论(0) 推荐(0) 编辑
    摘要:有规模限制的聚类算法背景介绍: 机器学习的聚类算法在很多场景中都有应用,比如用户群体的聚类,地址聚类等。但是,在实际问题中,我们的聚类问题常常是有类的规模限制的,比如我们需要创建几个等大的类,或者有最小类大小的限制等。 Github地址: https://github.com/jingw2/size_constrain 阅读全文
    posted @ 2020-11-26 10:37 Mr·Li程序员 阅读(1155) 评论(0) 推荐(0) 编辑
    摘要:服务后台运行一个任务并记录日志需求:在服务器上后台运行一个任务 实现: python3.7.6 /data/py_shell/dp_report/distributionOrder.py > /data/py_shell/dp_report/logs/distributionOrder_day.log 2>&1 & ← 后台运行 阅读全文
    posted @ 2020-11-26 10:03 Mr·Li程序员 阅读(465) 评论(0) 推荐(0) 编辑
    摘要:Mac上python多线程错误:...+[__NSPlaceholderDate initialize]...错误提示并且报pycharm异常退出 objc[27880]: +[__NSPlaceholderDate initialize] may have been in progress in another thread when fork() was called. objc[27880]: +[_ 阅读全文
    posted @ 2020-11-25 17:55 Mr·Li程序员 阅读(1423) 评论(0) 推荐(0) 编辑
    摘要:mac上virtualenvwrapper和virtualenv的使用1.virtualenv安装和使用 1)介绍 在python开发中,我们可能会遇到一种情况,就是当前的项目依赖的是某一个版本,但是另一个项目依赖的是另一个版本,这样就会造成依赖冲突,而virtualenv就是解决这种情况的,virtualenv通过创建一个虚拟化的python运行环境,将我们所需的依 阅读全文
    posted @ 2020-11-25 17:26 Mr·Li程序员 阅读(466) 评论(0) 推荐(0) 编辑

    点击右上角即可分享
    微信分享提示