博客
关于我
numpy 用法
阅读量:794 次
发布时间:2023-02-17

本文共 1755 字,大约阅读时间需要 5 分钟。

numpy??????

1. ????(array)

numpy?????????????????????????????np.array()??????????????shape??????????????

import numpy as nparr = np.array([1, 2, 3], dtype=np.int32)

2. ???????

?????????numpy????????????dtype???????????????itemsize????????????????

3. shape

shape???????????????shape??????????????????????????

arr = np.array([1, 2, 3, 4])arr.shape = (2, 2)

4. dtype ? itemsize

  • dtype??????????????dtype=np.float64????????
  • itemsize?????????????????itemsize=4??????????4???

5. size

size??????????????????

arr = np.array([1, 2, 3, 4])print(arr.size)  # ???4

6. nibbles??????????ndim???

  • nbytes??????????????
  • ndim??????????

7. fill

fill??????????????????????

8. ?????????complex?

numpy????????????????????????????dtype=np.complex128???

9. ???

negative?????????????

10. np.array ? np.asarray

  • np.array()???????????????????
  • np.asarray()??????????????numpy???

11. astype

astype?????????????????????

12. inf ? nan

  • inf???????
  • nan?????Not a Number??

13. zero?ones?arange

  • np.zeros()???????
  • np.ones()???????
  • np.arange()?????????

14. linspace

linspace???????????

15. ????

?????????????????????

16. shape ???????

????shape????????????????????????????

17. ndenumerate

ndenumerate????????????????

18. sum?prod?max?argmax

  • sum()???????????
  • prod()??????????
  • max()??????????
  • argmax()???????????

19. mean

mean()???????????

20. ???transpose?

T?transpose()??????????

21. ???concatenate?

np.concatenate()???????????

22. vstack?hstack?dstack

  • vstack()???????
  • hstack()???????
  • dstack()???????????

23. ????????

????????????????????

24. ????

np.dot()???????????

25. cos????

np.cos()??????np.sqrt()??????

26. all?any

  • all()????????????????
  • any()?????????????????

27. allclose

allclose()???????????????

28. ????

?????????????????????

29. ?????rand?randn?

  • rand()?????????????
  • randn()???????????

转载地址:http://lgjfk.baihongyu.com/

你可能感兴趣的文章
nrm —— 快速切换 NPM 源 (附带测速功能)
查看>>
nrm报错 [ERR_INVALID_ARG_TYPE]
查看>>
NS3 IP首部校验和
查看>>
NSDateFormatter的替代方法
查看>>
NSError 的使用方法
查看>>
NSGA-Ⅲ源代码
查看>>
nsis 安装脚本示例(转)
查看>>
NSJSON的用法(oc系统自带的解析方法)
查看>>
nslookup 的基本知识与命令详解
查看>>
NSNumber与NSInteger的区别 -bei
查看>>
NSOperation基本操作
查看>>
NSRange 范围
查看>>
NSSet集合 无序的 不能重复的
查看>>
NSURLSession下载和断点续传
查看>>
NSUserdefault读书笔记
查看>>
NS图绘制工具推荐
查看>>
NT AUTHORITY\NETWORK SERVICE 权限问题
查看>>
NT symbols are incorrect, please fix symbols
查看>>
ntelliJ IDEA 报错:找不到包或者找不到符号
查看>>
NTFS文件权限管理实战
查看>>