Skip to content

this repository saves commonly used function for data preparation, statistic analysis and machine learning

Notifications You must be signed in to change notification settings

ziyang-w/wzyFunc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

介绍

整个代码库主要存放本人在硕士期间编写的多种函数,目前仅主要包括以下几个方面:

  1. 数据预处理
  2. 统计学检验
  3. 机器学习
  4. 深度学习
  5. 绘图
  6. 办公自动化

其中,dataPrep.py是最常用到的一个模块,其中的make_logInfo函数会根据传入的数据路径和文件名,以及当前日期和时间,创建日志模块,方便保存后续数据分析和处理的结果。make_logInfo的返回结果logInfo会作为其他函数的参数传入,用于判断是否保存相关的数据。

代码会及时进行更新和完善,并且每个函数都附带了详细的注释。

TODO:

  • 介绍各个模块内函数的作用和调用逻辑
  • 完善深度学习的模块
  • 补充模块之间的摘要图

Python 包提交流程

  • 编写setup.py

    1. 包名称中亿数字+字母为主,最多出现-,其他的字符都可能会导致安装失败的问题
from setuptools import setup, find_packages

setup(
    name='my_package',
    version='0.1',
    author='Your Name',
    author_email='[email protected]',
    description='My Python Package',
    packages=find_packages(),
    install_requires=[
        'numpy>=1.18.0',
        'pandas>=1.0.0'
    ]
)
python setup.py dist bdist_wheel

该命令将会生成.tar.gz.whl两个格式的包文件,分别存放在dist目录下。

创建PyPI账号后,在Account Settings中按照要求设置Recover codes与2FA验证,iOS设备可以从APP Store中下载Duo软件进行扫码验证。TestPyPI与PyPI,可以仅注册PyPI即可,直接将包上传到PyPI中,但建议在上传前在本地进行测试。

设置了2FA验证后,提交包的密码不知道是哪个,一会儿要求原密码,一会儿要求2FA密码。很容易报错Invalid or non-existent authentication information,所以推荐设置API tokens的方式进行提交。

  • 添加API tokens

Account Settings中,找到Add API token,按照要求在当前操作系统的用户目录下新建.pypirc文件。

Windows可以在cmd中运行echo. > .pypirc,然后在用记事本打开。

Linux 直接vim ~/.pypirc,将生成的Token复制进去,:wq结束

.pypirc样例如下:

[distutils]
index-servers=pypi

[pypi]
  username = __token__
  password = pypi-GENERATED_API_TOKEN
  

REFERENCE

Python极简打包流程

About

this repository saves commonly used function for data preparation, statistic analysis and machine learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages