摘要: import org.apache.spark.SparkConfimport org.apache.spark.streaming.{Seconds, StreamingContext}// 创建一个本地模式的StreamingContext, 两个工作线程, 1s的批处理间隔//Master要求 阅读全文
posted @ 2021-07-02 12:29 tevien 阅读(41) 评论(0) 推荐(0)
摘要: import com.hankcs.hanlp.HanLPimport org.apache.spark.rdd.RDDimport org.apache.spark.{SparkConf, SparkContext}import scala.collection.immutable.StringO 阅读全文
posted @ 2021-07-02 12:27 tevien 阅读(90) 评论(0) 推荐(0)
摘要: # 豆瓣读书榜单import requests,csv, refrom bs4 import BeautifulSoupurl = "https://book.douban.com/top250?icn=index-book250-all"headers = { "Accept": "applica 阅读全文
posted @ 2021-03-30 18:38 tevien 阅读(178) 评论(0) 推荐(0)
摘要: import requests,csv, pymysqlfrom lxml import etree def ips(): try: db = pymysql.connect(host="localhost", user="root", password="123123", database="te 阅读全文
posted @ 2021-03-30 18:37 tevien 阅读(137) 评论(0) 推荐(0)
摘要: import pymysql, time # 登录系统def login(): try: db = pymysql.connect(host="localhost", user="root", password="123123", database="test") r = db.cursor() s 阅读全文
posted @ 2021-03-30 18:33 tevien 阅读(61) 评论(0) 推荐(0)
摘要: import requests, time def music(): key_name = input("输入要下载的歌曲:") num = input("第几页:") url1 = 'http://www.kuwo.cn/api/www/search/searchMusicBykeyWord?ke 阅读全文
posted @ 2021-03-30 18:30 tevien 阅读(69) 评论(0) 推荐(0)
摘要: import requestsimport json class qm: def __init__(self): self.headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, 阅读全文
posted @ 2021-03-30 18:29 tevien 阅读(184) 评论(0) 推荐(0)
摘要: # 计算K百分位数import numpy as npx = np.array([-35, 10, 20, 30, 40, 50, 60, 100])k = 25xk = np.percentile(x, k, interpolation='linear')Nx = x.shape[0]indice 阅读全文
posted @ 2021-03-17 14:57 tevien 阅读(259) 评论(0) 推荐(0)
摘要: 转:http://blog.csdn.net/xiaoguaihai/article/details/8705992 阅读全文
posted @ 2021-03-12 17:56 tevien 阅读(21) 评论(0) 推荐(0)
摘要: import requestsfrom lxml import etreedef jianli(): for s in range(2, 5): url1 = "http://www.gerenjianli.com/biaoge/index_" + str(s) + ".html" res = re 阅读全文
posted @ 2021-03-12 17:14 tevien 阅读(67) 评论(0) 推荐(0)