文章分类 -  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/ 我安装的 阅读全文
posted @ 2020-07-16 17:32 Adamanter 阅读(149) 评论(0) 推荐(0)
摘要:全部展示所有数据行列不隐藏(前提设置) 显示所有列: pd.set_option('display.max_columns', None) 显示所有行:pd.set_option('display.max_rows', None) 设置value的显示长度为60,默认为50:pd.set_optio 阅读全文
posted @ 2020-04-22 18:57 Adamanter 阅读(612) 评论(0) 推荐(0)
摘要:```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.... 阅读全文
posted @ 2019-12-18 15:54 Adamanter 阅读(797) 评论(0) 推荐(0)
摘要:注意存储过程的建立需要事先授权操作, 不然无法创建 语句 sql DELIMITER $$ USE $$ DROP PROCEDURE IF EXISTS $$ CREATE DEFINER= @`4x.2xx.38.2x2 mapping_date_type`(IN start_time INTE 阅读全文
posted @ 2019-12-11 16:39 Adamanter 阅读(160) 评论(0) 推荐(0)
摘要:python的upsert和pymysql结合使用 pycharm要复制为文本 py def upsert_event_data(): upsert_sql = f"insert into .`{MYSQL_EVENT_TABLE}` " \ f"(module_name, trigger_acti 阅读全文
posted @ 2019-12-11 16:34 Adamanter 阅读(3145) 评论(0) 推荐(0)
摘要:innodb 基本语句: float DEFAULT NULL COMMENT '带宽大小,Mbps', bigint(20) DEFAULT NULL COMMENT 'kafka记录数和', varchar(32) DEFAULT NULL COMMENT '最终使用的appkey', sql 阅读全文
posted @ 2019-12-11 16:33 Adamanter 阅读(863) 评论(0) 推荐(0)
摘要:1 elk是什么 pass 2 使用docker-compose搭建elk系统的链接 github使用人数很多的连接地址:https://github.com/deviantony/docker-elk/ 3 发送的日志在logstash接收到必须是json 发送时可以logger.info("he 阅读全文
posted @ 2019-06-19 12:01 Adamanter 阅读(262) 评论(0) 推荐(0)
摘要:官方镜像: 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 - 阅读全文
posted @ 2019-04-19 14:11 Adamanter 阅读(4812) 评论(0) 推荐(1)
摘要:# coding=utf-8 # 僵尸标签显示次序: # 性别:女士/男士 # 人种:白人/亚洲人/黑人/阿拉伯人 # 季节:春秋/夏季/冬季 # 场景:街头/都市(其它不显示) # 风格:预留(暂时没有) # 年龄组:儿童/老人(成人不显示) # 眼镜:太阳镜/眼镜(无不显示) # 人物:刘诗诗 # 秀场:2019秋冬高级成衣 # 品牌:Topshop Unique # 影视:知否(暂时没有... 阅读全文
posted @ 2019-04-13 18:08 Adamanter 阅读(654) 评论(0) 推荐(0)
摘要:# 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 ... 阅读全文
posted @ 2019-04-13 18:01 Adamanter 阅读(931) 评论(0) 推荐(0)
摘要:# 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:/... 阅读全文
posted @ 2019-04-13 17:54 Adamanter 阅读(194) 评论(0) 推荐(0)
摘要: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]... 阅读全文
posted @ 2019-04-13 17:53 Adamanter 阅读(993) 评论(0) 推荐(0)
摘要:sensetive_words.txt 阅读全文
posted @ 2019-04-13 17:44 Adamanter 阅读(794) 评论(0) 推荐(0)
摘要: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(... 阅读全文
posted @ 2019-04-13 17:38 Adamanter 阅读(160) 评论(0) 推荐(0)
摘要:from xpinyin import Pinyin pin = Pinyin() from collections import OrderedDict def deal_conversion(tags): """ 将标签中的值得中文名处理为拼音,英文名不变 :param tags: :return: """ _tags = [] ... 阅读全文
posted @ 2019-04-13 17:29 Adamanter 阅读(431) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2019-04-13 16:32 Adamanter 阅读(3567) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2019-04-13 16:23 Adamanter 阅读(287) 评论(0) 推荐(0)
摘要:from pymongo import MongoClientmdb = MongoClient('120.xxx.xxx.xxx:20002', username='xxx', password='xxx')# 数据240万# no_cursor_timeout=True代表连接不中断,连续取# 阅读全文
posted @ 2019-04-13 16:12 Adamanter 阅读(1285) 评论(0) 推荐(0)
摘要:es创建索引 es搜索 es类实现 阅读全文
posted @ 2019-04-13 15:52 Adamanter 阅读(655) 评论(0) 推荐(0)
摘要:import zlib post_id = "65fe4882de661f4a6e25391c790b6b86" post_id_crc32= zlib.crc32(post_id.encode("utf-8")) print(post_id_crc32) # 3217366125 阅读全文
posted @ 2019-04-13 15:42 Adamanter 阅读(3159) 评论(0) 推荐(0)