会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
阿布alone
博客园
首页
新随笔
订阅
管理
上一页
1
···
14
15
16
17
18
19
20
21
22
···
49
下一页
2020年6月24日
mongo数组查询
摘要: 一.嵌入式文档的查询 { "_id": 1, "user": { "name": "zhangsan", "user_id": 1, "age": 18 } } 直接用点取值就可以: db.getCollection('test').find({'user.age':{$gt:18}},{'_id'
阅读全文
posted @ 2020-06-24 00:18 阿布_alone
阅读(1477)
评论(0)
推荐(0)
2020年6月18日
后台运行scp(输入密码)
摘要: 步骤 1. scp -P xxxx user@xx.xx.xx.xx:aaa.txt . 2.输入密码 3.ctrl+z 暂停当前进程 4.bg(继续当前进程并切换到后台运行)
阅读全文
posted @ 2020-06-18 23:43 阿布_alone
阅读(1014)
评论(0)
推荐(0)
2020年6月14日
pysrapk 处理movielens
摘要: 1、数据集下载 https://grouplens.org/datasets/movielens 参考地址 2、数据集下文件格式u.user用户属性文件 包含user.id用户ID gender性别 occupation职业 ZIP code邮编等属性,每个属性之间用|分割 u.item电影元数据
阅读全文
posted @ 2020-06-14 23:25 阿布_alone
阅读(417)
评论(0)
推荐(0)
python中使用pyspark 读取和整理日志数据并将数据写入到es中去
摘要: 代码: import re import datetime from pyspark.sql import SparkSession from pyspark import SparkContext from elasticsearch import Elasticsearch spark=Spar
阅读全文
posted @ 2020-06-14 15:59 阿布_alone
阅读(900)
评论(0)
推荐(0)
2020年6月10日
elasticsearch对已存在的索引增加mapping字段
摘要: 一.为mapping增加字段,但是新增的字段之前数据已经写进索引了,所以,要从新索引 post 127.0.0.1/index/_mapping { "properties":{ "name":{ "type":"keyword" } } } 二.重新索引数据 POST 127.0.0.1/inde
阅读全文
posted @ 2020-06-10 23:52 阿布_alone
阅读(5143)
评论(0)
推荐(0)
2020年6月7日
dataclass初探
摘要: 初尝 Python 3.7 引入了一个新的模块,这个模块就是今天要试探的 dataclass。dataclass 的用法和普通的类装饰器没有任何区别,它的作用是替换定义类的时候的:def __init__()我们来看看如何使用它 # 我们需要引入 dataclass 包 from dataclass
阅读全文
posted @ 2020-06-07 23:57 阿布_alone
阅读(1124)
评论(0)
推荐(0)
requests分块下载文件
摘要: 将下载或上传任务(一个文件或一个压缩包)人为的划分为几个部分,每一个部分采用一个线程进行上传或下载,如果碰到网络故障,可以从已经上传或下载的部分开始继续上传下载未完成的部分,而没有必要从头开始上传下载。用户可以节省时间,提高速度。 一、分割视频 1、分割的每个小部分的大小: size = 1024
阅读全文
posted @ 2020-06-07 20:28 阿布_alone
阅读(1588)
评论(0)
推荐(0)
2020年6月6日
Python 判断字符串是否包含中文
摘要: 一、摘要 使用 xlrd 模块打开带中文的excel文件时,会报错。 FileNotFoundError: [Errno 2] No such file or directory: 'xx.xlsx' 这个时候,就需要检测文件名,是否包含中文,及时return。 二、原理 中文字符的编码范围是: \
阅读全文
posted @ 2020-06-06 23:29 阿布_alone
阅读(3310)
评论(0)
推荐(0)
sorte的使用
摘要: 代码: from collections import Counter lis = [1, 2, 3, 4, 5, 2, 3, 1, 2, 2] cc = Counter(lis) print(type(cc)) # <class 'collections.Counter'> print(cc) #
阅读全文
posted @ 2020-06-06 21:56 阿布_alone
阅读(216)
评论(0)
推荐(0)
python解压和压缩而文件
摘要: 1.tarfile模块的使用 import tarfile, os def tar_file(output_name, source_dir): """ 压缩文件,当直线打包而不需要压缩的时候只需要把mode传成"w" :param output_name:压缩后的文件名 :param sorce_
阅读全文
posted @ 2020-06-06 21:45 阿布_alone
阅读(384)
评论(0)
推荐(0)
上一页
1
···
14
15
16
17
18
19
20
21
22
···
49
下一页
公告
TOP