随笔分类 -  python

python语言学习
摘要:背景 将jupyter运行的环境指定为自己的环境 step 1 miniconda安装自己的python环境 https://www.yuque.com/hiahia121/kwx05s/fc4nww step2 将jupyter运行的环境指定自己新建的python环境 参考 https://sta 阅读全文
posted @ 2021-08-14 16:20 威威后花园 阅读(411) 评论(0) 推荐(0) 编辑
摘要:l1 = [174149,174183,174177,174171,174131,174087,174135,174181,174127,174145,174137,174111,174097,174185,174189,174145,174179,174163,174167,174095,1740 阅读全文
posted @ 2021-06-12 14:19 威威后花园 阅读(98) 评论(0) 推荐(0) 编辑
摘要:背景 python代码中使用post方法请求接口,并传了二进制的文件,如何将其改造成postman请求 python的函数请求方法如下 url = http://10.10.121.12:8080/xxx data_dict = {'data': '{"a": 1, "b": "[{\\"key\\ 阅读全文
posted @ 2021-05-19 16:42 威威后花园 阅读(812) 评论(0) 推荐(1) 编辑
摘要:import gc del X_train, X_test gc.collect() 阅读全文
posted @ 2020-12-22 17:31 威威后花园 阅读(13736) 评论(0) 推荐(2) 编辑
摘要:pd.read_csv() 阅读全文
posted @ 2020-12-10 13:41 威威后花园 阅读(53) 评论(0) 推荐(0) 编辑
摘要:step1: 安装jupyter python3 -m pip install jupyter step2: 启动jupyter cd /Library/Python/3.8/bin ./jupyter notebook 见下图表示运行成功 step3: 使用jupyter 新建hello.py 阅读全文
posted @ 2020-11-27 23:49 威威后花园 阅读(4040) 评论(0) 推荐(0) 编辑
摘要:pip安装 python3 -m pip install cvxpy 使用import cvxpy报错 解决方法 学习文档 https://www.cvxpy.org/tutorial/intro/index.html 阅读全文
posted @ 2020-11-17 15:48 威威后花园 阅读(568) 评论(0) 推荐(0) 编辑
摘要:背景 今天打算将放在本地mac上的一个170M大小的文件,远程传输到服务上。由于自己mac上安装的是iterm2,开始通过lrzsz命令,在服务器上使用rz来传输。发现贼慢,难以忍受。遂找快速传输文件的方法。 开始想在自己的mac上起ftp服务,折腾半天,没搞定。突然想到python 可以临时起ht 阅读全文
posted @ 2020-09-16 15:13 威威后花园 阅读(2052) 评论(0) 推荐(0) 编辑
摘要:class Solution(): def __init__(self, x): self.params = x def func(self): print(self.params) c++ class Solution{ public: Solution(int i){ cout << i << 阅读全文
posted @ 2020-09-10 09:54 威威后花园 阅读(256) 评论(0) 推荐(0) 编辑
摘要:collections.Counter学习 阅读全文
posted @ 2020-07-02 14:28 威威后花园 阅读(109) 评论(0) 推荐(0) 编辑
摘要:python 日志输出级别 import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s', da 阅读全文
posted @ 2020-06-05 11:30 威威后花园 阅读(237) 评论(0) 推荐(0) 编辑
摘要:背景 pip下载包的时候,国外源下载速度贼慢,尝试换成国内源 国内源有 阿里云 http://mirrors.aliyun.com/pypi/simple/ 豆瓣(douban) http://pypi.douban.com/simple/ 清华大学 https://pypi.tuna.tsingh 阅读全文
posted @ 2020-06-02 23:14 威威后花园 阅读(2177) 评论(0) 推荐(0) 编辑
摘要:背景 python进行源码安装到一个文件夹下,可以进行系统间的迁移。 step1:下载python源码包,https://www.python.org/downloads/release/python-367/ step2: 解压下载的python安装包 step3: ./configure --p 阅读全文
posted @ 2020-04-13 22:37 威威后花园 阅读(628) 评论(0) 推荐(0) 编辑
摘要:背景遇到mac中无法使用pip解决方案cd /tmpcurl https://bootstrap.pypa.io/get-pip.py -o get-pip.pysudo python get-pip.py或者sudo python3 get-pip.py 阅读全文
posted @ 2020-03-14 12:43 威威后花园 阅读(190) 评论(1) 推荐(0) 编辑
摘要:python装饰器的学习理解 自己的理解 装饰器是python语言中的高阶函数,被装饰的函数嵌套在装饰器内部,其目的可实现对被装饰函数的功能扩充。 举个例子,加深理解 任务:完成对执行函数func1的执行时间的记录 不用装饰器实现 # -*- coding: utf-8 -*-import time 阅读全文
posted @ 2020-02-28 21:42 威威后花园 阅读(160) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示