原创 cython - callback函數調用

find_cheeses.h 與 find_cheeses.c都是標準的c接口; 1. find_cheeses.h文件 // find_cheeses.h 文件 typedef void (*cheesefunc)(char *na

原创 Python學習筆記之(三) matplotlib.pyplot

1. 正態分佈 import numpy as np import matplotlib.pyplot as plt mu, sigma = 100, 15 x = mu + sigma * np.random.randn(10000

原创 backtrader學習筆記(二).RSI

#!/usr/bin/env python # -*- coding: utf-8 -*- # @license : (C) Copyright 2017-2020. # @contact : [email protected] # @Time

原创 Python學習筆記之(二) matplotlib.pyplot

1. Plotting 使用關鍵字data   import numpy as np import matplotlib.pyplot as plt data = {'a': np.arange(50), 'c': n

原创 Cython使用問題集合

1. Cython安裝, 比較簡單: pip install Cython 例1. 寫第一個程序- helloworld.pyx  1). 新建一個helloworld.pyx文件,如下所示: # cython: language_l

原创 python學習筆記之pyinstaller failed to execute script問題

  File "<frozen importlib._bootstrap>", line 983, in _find_and_load 使用pyinstaller -D demo.py 打包完成後,在dist\Demo目錄下,在cmd下

原创 backtrader學習筆記(一)

#!/usr/bin/env python # -*- coding: utf-8 -*- # @license : (C) Copyright 2017-2020. # @Time : 2020/5/23 13:01 # @Fi

原创 Python - PyQt5 - ModuleNotFoundError No module named PyQt5.Qsci

ModuleNotFoundError: No module named 'PyQt5.Qsci',出現這個問題,即使重新安裝 Qsci也是無用的; from PyQt5.Qsci import QsciScintilla Mo

原创 Python學習筆記之安裝TA-Lib talib

Python學習筆記之安裝TA-Lib talib,採用pip install TA-Lib可能要歇菜。 1. 安裝方式(windows): 下載 ta-lib-0.4.0-msvc.zip,解壓到 C:\ta-lib, 然後pip i

原创 tushare 之get_today_all出現ValueError: No ':' found when decoding object value問題

在使用tushare.get_today_all出現ValueError: No ':' found when decoding object value問題改如何解決呢? 這是你會發現,其實get_today_all從網頁獲取的數據時正

原创 tushare 之 RuntimeError: implement_array_function method already has a docstring

在Python中有時會出現RuntimeError: implement_array_function method already has a docstring?那如何解決呢? 此問題在matplotlib和pandas中容易出現。

原创 tushare 之 Python ‘cannot import name 'StringIO' from 'pandas.compat’解決方法

在使用tushare源碼進行獲取數據時,會出現Python ‘cannot import name 'StringIO' from 'pandas.compat’問題,那如何解決呢? # 在pandas v0.25.0 版本前處理方式

原创 Python學習筆記之Bytes與Str轉換

# bytes object b = b"11223344" # str object s = "xsophiax" # str to bytes stb = bytes(s, encoding = "utf8") print(st

原创 python學習筆記之兩個list之間的差異(差集、交集、並集、查重)

案例1: list_a = ['1', '2', '3', '4'] list_b = ['1', '2', '3', '5'] # diff # list_a對應list_b的差集 diff_a_b = set(list_a).di

原创 Python學習筆記之(一) matplotlib.pyplot

1.快速生成曲線 # Pyplot import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4]) plt.ylabel('some numbers') plt.show()   imp