文章分类 - Python
摘要:##### anaconda2-3 Anaconda2-5.0.0.1-Linux-x86_64.shAnaconda3-5.3.1-Linux-x86_64.sh 清华镜像源地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 我安装的
阅读全文
摘要:全部展示所有数据行列不隐藏(前提设置) 显示所有列: pd.set_option('display.max_columns', None) 显示所有行:pd.set_option('display.max_rows', None) 设置value的显示长度为60,默认为50:pd.set_optio
阅读全文
摘要:```py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "Victor"
# Date: 2019/12/18 from rediscluster import StrictRedisCluster INTERVAL_TIME = 1800
REDIS_NODES = [ {'host': '172.25....
阅读全文
摘要:注意存储过程的建立需要事先授权操作, 不然无法创建 语句 sql DELIMITER $$ USE $$ DROP PROCEDURE IF EXISTS $$ CREATE DEFINER= @`4x.2xx.38.2x2 mapping_date_type`(IN start_time INTE
阅读全文
摘要:python的upsert和pymysql结合使用 pycharm要复制为文本 py def upsert_event_data(): upsert_sql = f"insert into .`{MYSQL_EVENT_TABLE}` " \ f"(module_name, trigger_acti
阅读全文
摘要:innodb 基本语句: float DEFAULT NULL COMMENT '带宽大小,Mbps', bigint(20) DEFAULT NULL COMMENT 'kafka记录数和', varchar(32) DEFAULT NULL COMMENT '最终使用的appkey', sql
阅读全文
摘要:1 elk是什么 pass 2 使用docker-compose搭建elk系统的链接 github使用人数很多的连接地址:https://github.com/deviantony/docker-elk/ 3 发送的日志在logstash接收到必须是json 发送时可以logger.info("he
阅读全文
摘要:官方镜像: docker pull docker.elastic.co/elasticsearch/elasticsearch:6.5.4 要设置/root/data/esdata可读写 docker run --name es_test_01 -p 9200:9200 -p 9300:9300 -
阅读全文
摘要:# coding=utf-8 # 僵尸标签显示次序: # 性别:女士/男士 # 人种:白人/亚洲人/黑人/阿拉伯人 # 季节:春秋/夏季/冬季 # 场景:街头/都市(其它不显示) # 风格:预留(暂时没有) # 年龄组:儿童/老人(成人不显示) # 眼镜:太阳镜/眼镜(无不显示) # 人物:刘诗诗 # 秀场:2019秋冬高级成衣 # 品牌:Topshop Unique # 影视:知否(暂时没有...
阅读全文
摘要:# coding=utf-8 import asyncio async def consumer(n, q): print('consumer {}: starting'.format(n)) while True: print('consumer {}: waiting for item'.format(n)) item = await ...
阅读全文
摘要:# coding=utf-8 import asyncio import aiohttp async def myfunc(url): async with aiohttp.ClientSession() as session: payload = {'image_url': url} async with session.post('http:/...
阅读全文
摘要:url = "https://app-s3.aifashion.com/sssdska45565646.jpg" def get_hash_from_url(upload_url): format = upload_url.rsplit(".")[-1] s1 = upload_url.rsplit(".")[-2] md5 = s1.rsplit('/')[-1]...
阅读全文
摘要:import time from multiprocessing import Pool from tqdm import tqdm # 简单多进程 def hello_world(name): time.sleep(1) sentence = "hello world " + name return '{}'.format(sentence) def main(...
阅读全文
摘要:from xpinyin import Pinyin pin = Pinyin() from collections import OrderedDict def deal_conversion(tags): """ 将标签中的值得中文名处理为拼音,英文名不变 :param tags: :return: """ _tags = [] ...
阅读全文
摘要:import random import json import datetime import time from pymongo import MongoClient from pymongo import MongoClient, ASCENDING, UpdateOne, InsertOne, DeleteOne, ReplaceOne from pymongo.errors impor...
阅读全文
摘要:import time import datetime from bson.objectid import ObjectId from collections import Iterator class MyIter(Iterator): def __next__(self): return ObjectId() published_at = datetime.da...
阅读全文
摘要:from pymongo import MongoClientmdb = MongoClient('120.xxx.xxx.xxx:20002', username='xxx', password='xxx')# 数据240万# no_cursor_timeout=True代表连接不中断,连续取#
阅读全文
摘要:es创建索引 es搜索 es类实现
阅读全文
摘要:import zlib post_id = "65fe4882de661f4a6e25391c790b6b86" post_id_crc32= zlib.crc32(post_id.encode("utf-8")) print(post_id_crc32) # 3217366125
阅读全文

浙公网安备 33010602011771号