0%

我的疑惑:

2018年1月1日 下午4:07

疑惑一:

class 3:

疑惑二:


解答:
这三种数据结构,各有用途,根据用途来记就行。
list就有序列表。
tuple是在list的基础上,加上了只读属性
而dict是一种kv对应的关系
list和tuple之间的转换很简单
但key如果要转换成list,先要想清楚,为啥要转。
是只转key,还是只转v,还是kv都转
老师明白你的意思了,我是看到有人将list转换成了dict
这样是可以的。
共有6个item,key是每个元祖的第一个,value是第二个。
像这种结构的转换是不是直接记住就行了,其实没啥原因?
转成dict就会方便操作。
嗯。你把a想象成用户名,4是密码
后边都是一样
而且,我还发现他在转换的过程中去除重复项
key值是唯一的
不允许 重复
不用死记这样的情况,用到了,去百度,去问问,就会了。
多用几次就熟了

疑惑三:

疑惑四:


这里的print一次全部输出,并且只输出一次

疑惑五:


代码:

1
2
3
4
5
6
7
8
9
10
11
#numpy
import numpy as np
array_3x3 = np.arange(9).reshape(3,3)

x = np.matrix(array_3x3)
# print(array_3x3) #结果一样
y = np.mat(np.identity(3))
# y = np.array(np.identity(3))#结果一样
# print(np.identity(3)) #结果一样
print(x)
print(y)

疑惑5

疑惑6

1
2
3
4
5
6
7
# 散点图
n = 2048
x = np.random.randn(n)
y = np.random.randn(n)
t = np.arctan2(y, x)
print(t)
plt.scatter(x, y, c=t)

np.arctan2 怎么用
矩阵的除法如何计算,尤其是list1/list2

疑惑7

  1. 通过学习python中的各种库的过程来看,我是没有根据手册进行学习的能力的,百度成了我主要的工具。
  2. 原因出在了:对英文手册不理解,就和考六级似的

疑惑8

1
2
3
4
5
6
7
8
>>> import string
>>> print(string.lowercase)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'string' has no attribute 'lowercase'
>>> print(string.__file__)
/Users/czh/anaconda3/lib/python3.6/string.py
>>>

疑惑9

解答:x = x[:,np.newaxis]这句加上。增维不在本身基础上进行