![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
Yummy_Ou
这个作者很懒,什么都没留下…
展开
-
pip常用指令
查看所有第三方安装包pip list安装某包pip install numpy安装某包到指定文件夹下sudo pip install numpy --target=/usr/local/lib/python2.7/dist-packages安装指定版本的包pip install numpy=1.16.6查看某包信息pip show numpy...原创 2021-07-19 16:38:08 · 91 阅读 · 1 评论 -
Original error was: No module named _multiarray_umath
错误信息Traceback (most recent call last): File "/opt/ros/kinetic/bin/rqt_plot", line 6, in <module> from rqt_plot.plot import Plot File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_plot/plot.py", line 43, in <module> from .data_p原创 2021-06-23 17:21:01 · 780 阅读 · 0 评论 -
python动画 基于csv导出数据实现动态绘图 Animation
先看效果再看代码吧~主要难点在于动画与区域绘制效果步骤从csv读取数据绘图(两种:曲线与区域)动画保存与显示代码import numpy as npimport matplotlib.pyplot as pltfrom matplotlib.animation import FuncAnimationimport matplotlib.animation as animationimport pandas as pdfrom scipy import signaljo原创 2021-06-02 14:34:19 · 592 阅读 · 0 评论 -
python滤波器 lfilter和filtfilt 对比与应用 基于Butterworth Filter
lfilter可以在线滤波使用# initial filter param def init_filter(self, order, cutoff, fs): wn = 2.0*cutoff/fs self._b, self._a = sig.butter(order, wn, 'lowpass', analog = False) self._dss = sig.lfilter_zi(self._b, self._a)Plotinit_filter(order=3, cutoff=4, f原创 2021-03-23 14:41:48 · 2724 阅读 · 0 评论 -
ImportError: No module named ‘scipy.spatial.transform‘
注意python pkg的版本问题ErrorImportError: No module named 'scipy.spatial.transform'Solve已安装scipy,但要upgrade到1.2.0才可以用pip3 install scipy==1.2.0python2.x 使用 pip install scipy==1.2.0(Python2 和 3 可以同时存在使用噢,注意运行区分环境~)...原创 2021-03-19 10:41:00 · 3323 阅读 · 1 评论 -
C++ vector 关于容器扩容思考 对比Python
在读到文章《数据结构与算法之美》关于数组和容器一节时 (笔记在此),提到 容器的优点:将很多数组操作的细节封装起来,如数组插入、删除数据时需要搬移其他数据等支持动态扩容,每次存储空间不够的时候,它都会将空间自动扩容为 1.5 倍大小为什么是1.5倍呢,这个数据是固定的吗?于是在网上查找了资料,也对此进行了测试。1. 网上有1.5倍和2倍两者方法,不同编译器结果不一样gcc,python list是2倍VS是1.5倍两者的区别是,2倍扩容时间复杂度更优,可以保证时间复杂度 O(n)O原创 2020-07-26 00:24:42 · 453 阅读 · 0 评论 -
Matplotlib 多行多张图片排列最后一张居中 python
效果7张图,每行两张,最后一张位于中间方法使用matplotlib.gridspec分成四行四列gs = gridspec.GridSpec(4, 4)每行第一张图占0,1 位;第二张图占2,3位;最后一行的图占1,2位即:plt.subplot(gs[行, 列])# positionif (joint%2==0 and joint != 6): ax = plt.subplot(gs[int(joint/2), :2]) # 第一张图占0,1 位elif (joint ==原创 2020-06-03 00:34:25 · 2850 阅读 · 0 评论 -
matplotlib图片/子图标题置于底部 设置坐标轴位置 python
In my thesis, I need to show three activation functions’ figures in one row. There are 3 points should be considered:show subplotsmove the axis to the center of the figure, like a normal coordinate...原创 2020-04-08 03:53:43 · 14511 阅读 · 1 评论 -
循环神经网络RNN LSTM Pytorch的运用 padding处理
Theroy详细展示RNN的网络结构循环神经网络(Recurrent Neural Network,RNN)和 LSTMRNN理解常见RNN及其架构Theroy with codeRNN,写起来真的烦explain each parameters of RNN in pytorch: 最简单的RNN回归模型入门(PyTorch)一个使用RNN进行财务预测的PyTorch示例(...原创 2020-03-23 22:44:57 · 1941 阅读 · 0 评论 -
机器学习可视化调参 sklearn cv_results_使用与解析 网格搜索 python
Visualization of hyperparameters’ distributionIn order to get a smaller range of hyperparameters for hyperparameters searching (girdsearch or randomsearch)ReferencesThe usage of cv_results_ in S...原创 2020-03-11 23:25:08 · 7738 阅读 · 0 评论 -
numpy保存和读取dictionary字典 python
It is very important for training to record the parameters or data!Code import numpy as np # define dict = {'a' : {1,2,3}, 'b': {4,5,6}} # save np.save('dict.npy',dict) # load dict_load=np.loa...原创 2020-03-05 04:30:48 · 19723 阅读 · 3 评论 -
import pandas 错误 cannot import name 'hashtable'
Ubuntu 16.04Python 3.6.10Problemwhen I import pandas… File "/usr/lib/python3/dist-packages/pandas/__init__.py", line 7, in <module> from pandas import hashtable, tslib, libImportError: ...原创 2020-03-04 04:37:16 · 1316 阅读 · 0 评论 -
pip3错误 No module named 'pip._vendor.pkg_resources'
Problemwhen I want to call pip3 ...., the error shows as following:$ pip3 --version Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 33, in v...原创 2020-03-04 00:39:31 · 1386 阅读 · 0 评论 -
seaborn heatmap热力图用法 cbar水平横放 代码 python3
installsudo apt-get install python3-pandassudo apt-get install -y python3-seabornuseimport numpy as npimport matplotlibimport matplotlib.pyplot as pltimport seaborn as snsdef plot_heatmap(ro...原创 2020-03-04 00:23:25 · 5892 阅读 · 0 评论 -
超参数调整对比:网格搜索,随机搜索,贝叶斯优化 sklearn hyperopt
ML-sklearn参数随机优化:GridSearchCV、RandomizedSearchCV、hyperoptML模型超参数调节:网格搜索、随机搜索与贝叶斯优化贝叶斯优化: 一种更好的超参数调优方式Theroy: 贝叶斯优化/Bayesian OptimizationCompare with code in detail: 用贝叶斯优化进行超参数调优随机搜索RandomizedSea...原创 2020-02-28 20:25:45 · 3204 阅读 · 0 评论 -
Matplotlib错误 currently using agg, cannot show the figure
EnvironmentUbuntu 16.04Python 3.6.1 (there are both py2 and py3 in my system)(Note: run for python2, no error)ErrorMatplotlib can’t plot the imageUserWarning: Matplotlib is currently using agg, ...原创 2020-02-27 20:37:41 · 488 阅读 · 0 评论 -
python 插值法对比两组数据
Using python scipy.interpolate for 1d interpolationYou should avoid “A value in x_new is above the interpolation”, which means the range of inserted value (x) must smaller or equel to the basic inter...原创 2020-02-24 22:34:34 · 2747 阅读 · 0 评论 -
sklearn 创建自己的估计器 自定义estimators scikit-learn python
I should write an ELM_Estimator by inheriting the parent class BaseEstimator, RegressorMixin so that I can directly use GridSearchCV from sklearn more easily.References非常详细的sklearn介绍...原创 2020-02-07 17:49:49 · 2699 阅读 · 4 评论 -
ELM数据处理和调参经历 调参方法
After I build the ELM model(class), I should find the best result for my data.The most important thing to do is to process my data and find suitable parameters for my model.Butterworth FilterI use ...原创 2020-02-06 18:38:56 · 1583 阅读 · 0 评论 -
交叉验证(Cross Validation)和网格搜索(Grid Search)在python sklearn里的应用
Theoryclearly explain the theory of grid search and cross-validation, with an example about DecisionTree 决策树预测乳腺癌ML 入门:交叉验证与网格搜索算法sklearn - GridSearchCVoffical document about extimatorsDevelop...原创 2020-02-05 21:03:53 · 747 阅读 · 0 评论 -
python Matplotlib 多种实用功能的实现
多图合并显示:https://www.kesci.com/home/project/5b7ff5e631902f000f5d3760转载 2020-02-03 01:18:01 · 113 阅读 · 0 评论 -
Butterworth Filter 巴特沃斯滤波器的python代码应用
I have already got the data from the real robot, but the data is too wavy.So I choose a filter same as the paper by my supervisor to obtain a smoother curve.I use python to implement because my lear...原创 2020-01-30 19:03:56 · 11937 阅读 · 0 评论 -
解决无法安装更新python库scikit-learn
This library scikit-learn in python I need to use, but the version is too low now, so I should upgrade!When I just use this command: pip install --upgrade scikit-learnThe error is showed:ERROR: C...原创 2020-01-01 00:24:55 · 677 阅读 · 0 评论