![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
疑难杂症
I-DONT-SLEEP
这个作者很懒,什么都没留下…
展开
-
networkx报错:TypeError: object of type 'dictionary-keyiterator' has no len()
TypeError: object of type 'dictionary-keyiterator' has no len()这是networkx1.x和network2.x不同导致的在node集合的基础上加list()即可更多:https://blog.csdn.net/csu150208/article/details/104816525https://networkx.g...原创 2020-03-12 20:27:13 · 1346 阅读 · 0 评论 -
Networkx报错 AttributeError: 'NodeView' object has no attribute 'remove'
错误描述我用的版本是python2.7+networkx2.2。部分代码:#G2是传入的一个随机网络unsaturated_b = G2.nodes()unsaturated_b.remove(node_b)最后一行报错,提示AttributeError: 'NodeView' object has no attribute 'remove'解决办法这是由于network...原创 2020-03-12 13:01:03 · 1911 阅读 · 0 评论 -
networkx画图报错 ValueError: max() arg is an empty sequence
错误描述用python的networkx包画图:import networkx as nximport matplotlib.pyplot as pltg=nx.Graph()g.add_nodes_from([1,2,3,4,5])g.add_edges_from([(1,2),(2,3),(3,4),(4,5),(5,1)])nx.draw(g, with_labels=F...原创 2020-03-12 10:29:43 · 1630 阅读 · 0 评论 -
【seaborn】ValueError: Colormap Y1GnBu is not recognized.
ValueError: Colormap Y1GnBu is not recognized.错误代码:corrmat=df_train.corr()f,ax=plt.subplots(figsize=(12,9))sns.heatmap(corrmat,square=True,cmap='Y1GnBu')样本是由多维属性构成的,把每个属性维度都看成一个随机变量,为了考查两两属性间...原创 2019-11-24 17:31:54 · 1585 阅读 · 0 评论 -
【matplotlib】AttributeError: Unknown property figsize
AttributeError: Unknown property figsize 属性错误:未知属性figsize原代码:var='YearBuilt'data=pd.concat([df_train['SalePrice'],df_train[var]],axis=1)f,ax=plt.subplot(figsize=(8,6))fig=sns.boxplot(x=var...原创 2019-11-24 17:08:13 · 1602 阅读 · 1 评论 -
【pandas】TypeError: concat() got multiple values for argument 'axis'
TypeError: concat() got multiple values for argument 'axis'原代码:var='LotArea'data=pd.concat(df_train['SalePrice'],df_train[var],axis=1)data.plot.scatter(x=var,y='SalePrice',ylim=(0,800000))大概是...原创 2019-11-24 16:41:18 · 14996 阅读 · 0 评论 -
python缩进问题IndentationError
IndentationError: unexpected indentpython是一种对缩进(indentation)非常敏感的语言,初学者常常容易忽视一个空格和tab,往往因为没有对齐就会报错。在命令行中尤其容易搞错,注意了注意了注意了(复制粘贴的时候也经常容易搞错...原创 2019-04-13 21:22:04 · 422 阅读 · 0 评论 -
ERROR: You must give at least one requirement to install (see "pip help install")
使用pip install 命令时遇到You must give at least one requirement to install (see "pip help install")原因是install后面没有参数,也就是说没有给想要安装的包可能是因为后面的网站链接写错了,或者是网站的资源搬迁了到资源网站上检查一下,修改成正确的资源地址即可...原创 2019-03-31 14:04:24 · 92060 阅读 · 4 评论 -
No module named 'numpy.core._multiarray_umath'
导入tensorflow后遇到No module named 'numpy.core._multiarray_umath'原因是numpy的当前版本过低解决办法:更新numpy的版本命令行输入:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade numpy升级后再导入tensorflow...原创 2019-03-31 13:57:23 · 7716 阅读 · 0 评论 -
Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
导入tensorflow并调用其函数后遇到Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2原因是下载TensorFlow的版本不支持cpu的AVX2指令编译 解决办法:1、卸载当前tensorflow版本,重新下载正确版本的tensorflow 。重新下...原创 2019-03-31 13:50:47 · 2742 阅读 · 0 评论