上一页 1 2 3 4 5 6 7 ··· 20 下一页
摘要: # -*- coding: utf-8 -*- import io import json from pathlib import Path from PIL import Image import base64 import cv2 import time import requests sess 阅读全文
posted @ 2022-07-31 23:02 莫贞俊晗 阅读(534) 评论(0) 推荐(0) 编辑
摘要: def sync_goods_producer(path): # doc_data = pandas.read_excel(path, skiprows=44, engine='xlrd') doc_data = pandas.read_excel(path,engine='xlrd') doc_d 阅读全文
posted @ 2022-07-22 17:19 莫贞俊晗 阅读(80) 评论(0) 推荐(0) 编辑
摘要: import xlwt import pymongo import pandas as pd import xlsxwriter as xw # 连接mongodb数据库 client = pymongo.MongoClient("localhost") # 连接数据库 db = client["D 阅读全文
posted @ 2022-07-22 11:14 莫贞俊晗 阅读(117) 评论(0) 推荐(0) 编辑
摘要: enumerate()是python的内置函数、适用于python2.x和python3.x enumerate在字典上是枚举、列举的意思 enumerate参数为可遍历/可迭代的对象(如列表、字符串) enumerate多用于在for循环中得到计数,利用它可以同时获得索引和值,即需要index和v 阅读全文
posted @ 2022-07-20 22:17 莫贞俊晗 阅读(4903) 评论(0) 推荐(0) 编辑
摘要: { "_id" : ObjectId("5e908fa139cfeaaf0b97b57b"), "Name" : "Chris", "Age" : 21 } { "_id" : ObjectId("5e908fa939cfeaaf0b97b57c"), "Name" : "David", "Age" 阅读全文
posted @ 2022-07-20 15:44 莫贞俊晗 阅读(186) 评论(0) 推荐(0) 编辑
摘要: ###案例1 item1 = {} gender_areas = [] for ge in gender: # 男性 man = ge.split(":")[0].strip() or '' # print("man",man) # 男性比例 man_percent = ge.split(":")[ 阅读全文
posted @ 2022-07-16 18:30 莫贞俊晗 阅读(331) 评论(0) 推荐(0) 编辑
摘要: ###1.插入数据 1. >>> import redis 2. 3. >>> conn = redis.Redis(host='192.168.8.176',port=6379) 4. 5. >>> pipe = conn.pipeline() 6. 7. >>> pipe.hset("hash_ 阅读全文
posted @ 2022-07-05 21:54 莫贞俊晗 阅读(496) 评论(0) 推荐(0) 编辑
摘要: 注意 break for doc in documents: print("doc=", doc) nick = doc.get("Nick") print("nick",nick) url = doc.get("shopIdurl") for doc1 in documents1: user_na 阅读全文
posted @ 2022-06-25 17:09 莫贞俊晗 阅读(108) 评论(0) 推荐(0) 编辑
摘要: MongoDB是一个跨平台的NoSQL,基于Key-Value形式保存数据。其储存格式非常类似于Python的字典,因此用Python操作MongoDB会非常的容易。 对Mongo简单的操作代码如下: #encoding:utf=8 import pymongo ################## 阅读全文
posted @ 2022-06-25 16:41 莫贞俊晗 阅读(46) 评论(0) 推荐(0) 编辑
摘要: urlencode() 传入参数类型:字典 功能:将存入的字典参数编码为URL查询字符串,即转换成以key1=value1&key2=value2的形式 导入:from urllib.parse import urlencode Ps:url单个字符串编码用quote()函数 ###1.url标准符 阅读全文
posted @ 2022-06-08 12:42 莫贞俊晗 阅读(4315) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 20 下一页