zoukankan      html  css  js  c++  java
  • python package install error and little code bugs

    When you install packages using setup.py, the error:

    (py37) C:UserswedaPhdpython packagesvisibility_graph-0.4>python setup.py install
    Traceback (most recent call last):
    File "setup.py", line 11, in 
    long_description=readme(),
    File "setup.py", line 5, in readme
    return f.read()
    File "C:UserswedaAppDataLocalContinuumanaconda3envspy37libencodingscp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1725: character maps to

    Here's the solution:  stackoverflow


    The difference of ndarray declare.

    a = np.array([0,0,24])
    a.shape
    (3,)
    a
    array([ 0,  0, 24])
    a = np.array((1,2))
    a
    array([1, 2])
    a.shape
    (2,)

    There's no difference of passing parameter in () or [] format. And the first parameter represent the data value. 

    numpy.array(objectdtype=Nonecopy=Trueorder='K'subok=Falsendmin=0)

    a = np.zeros([0,0,24])
    a.shape
    (0, 0, 24)
    a
    array([], shape=(0, 0, 24), dtype=float64)

    numpy.zeros(shapedtype=floatorder='C'); The first parameter is shape with [].

    The problem when converting list into ndarray: list长度不规则


     另一个小问题,赋值问题,a = a.tolist(), dataframe = dataframe.drop([count]); 这些函数返回新的值,需要重新赋值。

    list.remove(), the parameter is the value of deleted item and cannot be the index. Otherwise, you need to use 'del' function or 'pop' function. From here

  • 相关阅读:
    MyCat简介+Mybatis实现多租户(链接)
    mybatis的sql执行过程底层源码分析和缓存原理分析
    推荐算法数据集
    CentOS系统初始化
    NAT
    VRRP
    BGP协议的原理及应用
    ospf协议的重分发
    静态路由的原理与配置、动态路由
    OSPF (企业内部使用的动态路由协议)
  • 原文地址:https://www.cnblogs.com/dulun/p/11535756.html
Copyright © 2011-2022 走看看