Python科学计算工具包

import numpy as np
# 创建一个Ndarray
# 1. 从list对象中创建

# 2. 创建一个特定的数组,全1数组ones,随机数组random.randn,对角矩阵diag

# 数组的属性:ndim,shape,size,dtype

# 数组的索引

# 1. 索引index
# 2. 切片slicing

lst = [1,2,3]
a = np.array(lst)
type(a)

Python科学计算工具包

Python科学计算工具包

Python科学计算工具包

import numpy as np
# 创建一个Ndarray
# 1. 从list对象中创建

# 2. 创建一个特定的数组,全1数组ones,随机数组random.randn,对角矩阵diag

# 数组的属性:ndim,shape,size,dtype

# 数组的索引

# 1. 索引index
# 2. 切片slicing

lst = [1,2,3]
a = np.array(lst)
type(a)
np.ones((2,3))
np.random.randn(2,3,2)

 

相关文章:

  • 2022-12-23
  • 2021-11-06
  • 2022-01-23
  • 2022-12-23
  • 2021-06-17
  • 2021-08-20
  • 2021-06-11
  • 2021-08-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-07-11
  • 2022-12-23
  • 2021-05-14
  • 2021-12-16
相关资源
相似解决方案