11 2019 档案

摘要:一、es的使用 1、检索文档: 想要从Elasticsearch中获取文档,我们使用同样的 _index 、 _type 、 _id ,但是HTTP方法改为 GET : GET /{index}/{type}/{id}?pretty 这里pretty的作用:在任意的查询字符串中增加 pretty 参 阅读全文
posted @ 2019-11-28 16:03 睡觉了嘛 阅读(444) 评论(0) 推荐(0) 编辑
摘要:一、es中文档的元数据包括: 1、_index: 索引(index)类似于关系型数据库里的数据库(database),事实上,我们的数据被存储和索引在分片(shards)中,索引知识把一个或多个分片分组在一起的逻辑空间, 索引名字必须全部小写,不能以下划线开头,不能包含逗号。 2、_type: 类型 阅读全文
posted @ 2019-11-28 16:01 睡觉了嘛 阅读(1601) 评论(0) 推荐(0) 编辑
摘要:1、为null或者不存在 db.test.find({"test":null}); 2、不为null并且存在记录 db.test.find({"test":{"$ne":null}}); db.test.find({"test":{"$ne":null, $exists:true}}); 3.存在 阅读全文
posted @ 2019-11-28 15:57 睡觉了嘛 阅读(154) 评论(0) 推荐(0) 编辑
摘要:import pymongo import math from elasticsearch import Elasticsearch from elasticsearch import helpers import time HOST = ['ip:端口'] es = Elasticsearch(H 阅读全文
posted @ 2019-11-28 15:52 睡觉了嘛 阅读(314) 评论(0) 推荐(0) 编辑
摘要:split 对列表进行切割,然后生产新的列表 from pyspark.sql.functions import split# 对 key列按照 0-9之间的数字进行风格 重新命名为 s df.select(split(df.key, '[0-9]+').alias('s'))df1 = df.se 阅读全文
posted @ 2019-11-21 15:16 睡觉了嘛 阅读(3706) 评论(0) 推荐(0) 编辑
摘要:from kafka import KafkaConsumer,TopicPartition import json scrapy_kafka_hosts = ["ip:端口", "ip:端口"] topic = 'wangliang_test' consumer = KafkaConsumer(b 阅读全文
posted @ 2019-11-21 14:05 睡觉了嘛 阅读(370) 评论(0) 推荐(0) 编辑
摘要:from kafka import KafkaProducer import json scrapy_kafka_hosts = ["ip1:端口", "ip2:端口"] topic = 'wangliang_test' # 主题 producer = KafkaProducer(bootstrap 阅读全文
posted @ 2019-11-21 13:57 睡觉了嘛 阅读(116) 评论(0) 推荐(0) 编辑
摘要:DF 类似于二维表的数据结果 mame age 狗山石 23 获取df的列名: df.columns显示当前值 打印 df.show() show(2) show括号里面传入参数可以显示查看几行 show(2,False) False 是否全部显示 False 不隐藏 获取前10行数据 df.lim 阅读全文
posted @ 2019-11-21 13:33 睡觉了嘛 阅读(2506) 评论(0) 推荐(0) 编辑
摘要:from selenium import webdriver chrome_options = webdriver.ChromeOptions() prefs={"profile.managed_default_content_settings.images":2} chrome_opt.add_e 阅读全文
posted @ 2019-11-20 09:31 睡觉了嘛 阅读(379) 评论(0) 推荐(0) 编辑
摘要:from selenium import webdriver PROXY = "" chrome_options = webdriver.ChromeOptions() prefs = { "profile.default_content_setting_values" : { "notificat 阅读全文
posted @ 2019-11-20 09:30 睡觉了嘛 阅读(329) 评论(0) 推荐(0) 编辑
摘要:(1)_xxx "单下划线 " 开始的成员变量相当于私有变量,也叫做保护变量,意思是只有类实例和子类实例能访问到这些变量,需通过类提供的接口进行访问(可以定义有点像java中的getter、setter方法,借助方法访问,而不是直接对变量动刀子);不能用'from module import *'导 阅读全文
posted @ 2019-11-13 19:23 睡觉了嘛 阅读(500) 评论(0) 推荐(0) 编辑
摘要:import requests url = "https://magi.com/search" querystring = {"q":"堕却乡"} headers = { 'authority': "magi.com", 'pragma': "no-cache", 'cache-control': 阅读全文
posted @ 2019-11-13 14:22 睡觉了嘛 阅读(249) 评论(0) 推荐(0) 编辑
摘要:demjson.decode() 可以扩展json的类型 阅读全文
posted @ 2019-11-12 10:36 睡觉了嘛 阅读(123) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/nihaoxiaocui/article/details/95060906 https://xuexiyuan.cn/article/detail/173.html from etlsdk.lib.datasources.datasource_factor 阅读全文
posted @ 2019-11-12 09:09 睡觉了嘛 阅读(876) 评论(0) 推荐(0) 编辑
摘要:1. 描述Python中的 isinstance() 函数,是Python中的一个内置函数,用来判断一个函数是否是一个已知的类型,类似 type()。 2. 语法isinstance(object,classinfo)1参数: object : 实例对象。classinfo : 可以是直接或者间接类 阅读全文
posted @ 2019-11-11 17:14 睡觉了嘛 阅读(380) 评论(0) 推荐(0) 编辑

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