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