python中各种东西的方便实用功能
jutils的Python项目详细描述
jutils
我经常使用的一组有用的python代码片段。
开始
先决条件
安装
pip install .
日晷.dimred
尺寸缩减函数模块。
fromjutils.dimredimporttsne_kwargs,reduce_dimsimportnumpyasnpfeatures=np.loadtxt('path/to/features/file')kwargs=tsne_kwargs(n_dims=2,initial_dims=100)reduced_features=reduce_dims(features,**kwargs,technique='tsne')
柱状图
常用绘图模块
fromjutils.plotimportScatter3dimportnumpyasnpfeatures=np.loadtxt('path/to/features/file')labels=np.loadtxt('path/to/labels/file')fig=Scatter3d(features,labels)fig.write_html('my_figure.html',auto_open=True)
jutils.image.gifer
将一系列图像按其名称中的数字顺序转换为gif格式
fromjutils.imageimportgifergifer(glob_pattern='in/*',out_fpath='ouput.gif')