python
bald
只是做一些微小的记录。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
python 基本函数之每天一个写bug小技巧 [useful function! -- something you will always use!]
目录test test原创 2020-08-26 01:03:45 · 611 阅读 · 0 评论 -
object of type 'NoneType' has no len() -- python append 的大坑
我们都知道,python list 有好几种添加元素的方法: append extend + 然而这几种是有区别的,最坑的区别就是,使用append时,没有返回值 也就是说,当在某个函数func()中传入 func(my_list.append(1)) 的话,往往是会报错的,因为传进去的是 None ...原创 2019-09-16 21:24:00 · 9000 阅读 · 1 评论 -
python 生成requirements.txt 文件
1. pip 生成 生成当前python环境下的requirements.txt文件,即当前环境下的包版本 直接敲命令pip freeze > requirements.txt 即可 根据requirements.txt按照包 有了requirements.txt怎么下载相应版本: pip install -r requirements.txt 2.conda 生成 conda list -...原创 2019-09-11 19:17:40 · 353 阅读 · 0 评论 -
python networkx 用法 -- 每天一个写 bug 小技巧
创建图 import networkx as nx G = nx.Graph() # 创建空图 G = nx.karate_club_graph() # 创建karate图,经典图之一(还有很多其他的 可视化 import networkx as nx import matplotlib matplotlib.use("TkAgg") import matplotlib.pyplot as ...原创 2019-08-31 22:22:43 · 571 阅读 · 0 评论 -
tensorboard持续更新
查看loss曲线 命令行: tensorboard --logdir=event所在的文件夹路径 注意: 是文件夹! 接着会显示一个地址,点开,但是我从来没有成功打开过,直接在地址栏敲: http://localhost:6006 就可以 ...原创 2019-08-21 19:33:04 · 1359 阅读 · 0 评论 -
numpy random 持续更新
np.random.rand(d0,d1, …, dn) 生成[0,1)之间的数 np.random.randn(d0,d1, …, dn) 标准正态分布 np.random.randint(low, high=None, size=None, dtype = ‘I’) 返回整数,区间为[low,high) size是数组大小 ...原创 2019-08-21 14:38:48 · 200 阅读 · 0 评论 -
leetcode problem 399. Evaluate Division
20190719 Description Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the a...原创 2019-07-19 22:02:41 · 209 阅读 · 0 评论 -
networkx.draw() unrecognized selector sent to instance 0x7fe5e85f7fd0 解决 [mac] python3
import networkx as nx import matplotlib.pyplot as plt # generate a network G = nx.random_graphs.barabasi_albert_graph(100,1) #生成一个BA无标度网络G nx.draw(G) #绘制网络G plt.savefig("...原创 2019-04-13 17:13:33 · 416 阅读 · 0 评论
分享