python package install error and little code bugs
2024-10-08 09:40:49
When you install packages using setup.py, the error:
(py37) C:\Users\weda\Phd\python packages\visibility_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:\Users\weda\AppData\Local\Continuum\anaconda3\envs\py37\lib\encodings\cp1252.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
(object, dtype=None, copy=True, order='K', subok=False, ndmin=0)
a = np.zeros([0,0,24])
a.shape
(0, 0, 24)
a
array([], shape=(0, 0, 24), dtype=float64)
numpy.
zeros
(shape, dtype=float, order='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.
最新文章
- 笔记整理之BCP
- jquery一些基本函数
- HttpClient + Jsoup模拟登录教务处并获取课表
- Tomcat系列之Java技术详解
- java基础-基础类型包装类型
- c#基础知识对比(面向对象)
- [二]Ajax基本实现
- 【POJ2774】Long Long Message (后缀数组)
- CSS控制表单
- sctf pwn300
- SQLServer 2008的组成
- android JB2连拍降速原理介绍
- mac 下mysql
- Socket网络编程详解
- Git常用命令及场景
- TP thinkphp 权限管理 权限认证 功能
- Django的路由层(2)
- 带你从零学ReactNative开发跨平台App开发-[react native 仿boss直聘](十三)
- 第六章、Linux 的文件权限与目录配置
- CSS3 简介