当前位置:网站首页>np.astype()
np.astype()
2022-06-29 09:49:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
1.作用:就是转换numpy数组的数据类型
举个例子
arr = np.arange((10))
print(arr, arr.dtype, sep="\n")
===================================
[0 1 2 3 4 5 6 7 8 9]
int32 #可以看到,他的数据类型为 int32np.astype()
arr = arr.astype("float32")
print(arr, arr.dtype, sep="\n")
===================================
[0. 1. 2. 3. 4. 5. 6. 7. 8. 9.]
float32 #可以看到数据类型转换成了 float32用法:arr.astype(“具体的数据类型”)
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/132453.html原文链接:https://javaforall.cn
边栏推荐
- 攻防世界-Re-insfsay
- AQS之Atomic详解
- BUUCTF--reverse1
- IIS server related error
- Analysis on the specific execution process of an insert statement in MySQL 8.0 (2)
- Comment terminer rapidement une partition de disque
- 如何优雅的写 Controller 层代码?
- Learn spark computing framework in practice (00)
- Basic operations during dev use
- Contents of advanced mathematics
猜你喜欢

【动态规划】—— 线性DP

CS231n-2022 Module1: 神经网络要点概述(2)

Automatic 3D Detection and Segmentation of Head and Neck Cancer from MRI Data.

The product strength is not inferior to that of BYD. Geely Dihao l Raytheon hi · x delivered 10000 units in the first month

Design of intelligent test paper generation system

Offensive and defensive world re insfsay

Redis installation and cluster setup under Linux

Bug description, rating and life cycle

arcgis创建postgre企业级数据库

【C语言进阶】字符串和内存函数(二)
随机推荐
js post下载文件
区域工业互联网市场成绩单,百度智能云开物第二
zabbix监控mysql各项指标
你的项目需要自动化测试吗?
Win32exception (0x80004005): This program is blocked by group policy. For more information, contact your system administrator.
《MongoDB入门教程》第02篇 MongoDB安装
产品力不输比亚迪,吉利帝豪L雷神Hi·X首月交付1万台
高效工作必备:测试人如何提高沟通技能?
Oracle reset sequence generator (non rebuild)
CLR via C reading notes - loading and AppDomain
Atomic explanation of AQS
WinForm uses zxing to generate QR code
免费送书啦!畅销书《 OpenCV图像处理入门与实践》一本全搞定
AQS之ReentrantLock源码解析
Analysis of BlockingQueue source code of AQS
认不出原来的模样
Excel date and number format processing
AGCTFb部分题解
Linux下Redis安装及集群搭建
C language printf family