当前位置:网站首页>numpy 数据类型转化
numpy 数据类型转化
2022-07-27 05:01:00 【CharlesLC的博客】
查看数据类型:dtype
例子1:
In[1]: a = np.arange(5)
In[2]: a.dtype
Out[1]: dtype('int32')
例子2:
In[1]: b = np.array([1.00, 2.00 ,3.00 ,4.00 ], dtype=np.float64)
In[2]: b.dtype
Out[1]: dtype('float64')
数据转换:astype
例子1:
In[1]: a = a.astype(np.float64)
In[1]: a.dtype
Out[1]: dtype('float64')
例子2:
In[1]: b = b.astype(np.int32)
In[2]: b.dtype
Out[2]: dtype('int32')
边栏推荐
- File dialog box
- LeetCode之268.Missing number
- MQ message queue is used to design the high concurrency of the order placing process, the generation scenarios and solutions of message squeeze, message loss and message repetition
- 牛客剑指offer--JZ12 矩阵中的路径
- Machine learning overview
- Acticiti中startProcessInstanceByKey方法在variable表中的如何存储
- 弹球小游戏
- 2022年郑州轻工业新生赛题目-打死我也不说
- 34. 分析flexible.js
- Install pyGame
猜你喜欢
随机推荐
DBUtils
JVM Part 1: memory and garbage collection part 14 -- garbage collector
JVM Part 1: memory and garbage collection part 12 -- stringtable
How does the TCP server handle multiple client connections on one port (one-to-one or one to many)
2022年郑州轻工业新生赛题目-打死我也不说
B1030 perfect sequence
文件处理(IO)
B1026 program running time
Scientific Computing Library -- Matplotlib
JVM上篇:内存与垃圾回收篇三--运行时数据区-概述及线程
Translation of robot and precise vehicle localization based on multi sensor fusion in diverse city scenes
1、 MySQL Foundation
A math problem cost the chip giant $500million
整合SSM
如何快速有效解决数据库连接失败问题
34. Analyze flexible.js
Installation and template setting of integrated development environment pychar
Detailed description of binary search tree
素数筛选(埃氏筛法,区间筛法,欧拉筛法)
Select user stories | the false positive rate of hole state in jushuitan is almost 0. How to do this?









