摘要: talib文档 --> Math Operators from talib import * import numpy as np a = np.arange(10) a = a.astype('float') # print(a) # array([ 0., 1., 2., 3., 4., 5., 阅读全文
posted @ 2022-11-21 12:41 meizhengchao 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 可变参数作为对象的默认值的时候 创建不同的对象(均为默认值)的时候,默认值会具有相同的引用 def f(a = []): a.append(1) return a print(f()) print(f()) print(f()) # 输出 # [1] # [1, 1] # [1, 1, 1] 正确的 阅读全文
posted @ 2022-11-08 13:13 meizhengchao 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 数值数据分类后交叉,但是数据量少,或者划分标准不科学 导致分类的类别有缺失,交叉后会丧失类别,数据不齐整 import numpy as np import pandas as pd df = pd.DataFrame(np.random.rand(100,2)) bins = np.arange( 阅读全文
posted @ 2022-11-06 14:02 meizhengchao 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 因为数据量太大,需要用x轴滑块选择范围看数据 同时,范围内的数据维度太多,导致图形比较乱 需要将trace绘制到不同的子图中 产生了将x轴的滑块滑动范围同步的需求 实现方法是共享x轴 import plotly as py from plotly import graph_objects as go 阅读全文
posted @ 2022-11-06 12:19 meizhengchao 阅读(412) 评论(0) 推荐(0) 编辑
摘要: 目标做链接数据库的数据维护小脚本,可查询下载上传更新数据库的数据 获取上传文件与下载文件路径 from PyQt5.QtWidgets import QFileDialog, QMessageBox class Window_WH(): def __init__(self): self.mainwi 阅读全文
posted @ 2022-10-01 18:08 meizhengchao 阅读(81) 评论(0) 推荐(0) 编辑
摘要: # plotly 中的标记样式表 ['circle', 'square', 'diamond', 'cross', 'x', 'triangle-up', 'triangle-down', 'triangle-left', 'triangle-right', 'triangle-ne', 'tria 阅读全文
posted @ 2022-09-17 11:41 meizhengchao 阅读(160) 评论(0) 推荐(0) 编辑
摘要: pandas 转化 数据为DataFrame后,DataFrame不能够print 否则会报错AttributeError: 'NoneType' object has no attribute 'total_seconds' #data的数据结构大致为[{...,'datetime':dateti 阅读全文
posted @ 2022-09-14 21:16 meizhengchao 阅读(1732) 评论(0) 推荐(1) 编辑
摘要: 基于优先获取item的想法,最下级请求最优先 请求优先级是基于scrapy有很多请求要发起的情况 priority越大请求越优先 不在设置中修改配置 scrapy代码太复杂,这是目前可以接受的解决办法 class xxxspiderSpider(scrapy.Spider): # 三级请求优先级逐级 阅读全文
posted @ 2022-08-16 15:24 meizhengchao 阅读(249) 评论(0) 推荐(0) 编辑
摘要: class a(): def a1(self): print(self.a2()) def a2(self): return 'a-a2' class aa(a): def a2(self): return 'aa-a2' c = aa() c.a1() # 输出aa-a2 阅读全文
posted @ 2022-01-03 18:41 meizhengchao 阅读(4) 评论(0) 推荐(0) 编辑
摘要: # 无头浏览器下载地址:http://chromedriver.storage.googleapis.com/index.html from selenium import webdriver # 1. 添加浏览器设置参数对象 options = webdriver.ChromeOptions() 阅读全文
posted @ 2021-05-29 16:45 meizhengchao 阅读(293) 评论(0) 推荐(0) 编辑