当前位置:网站首页>Numpy data type conversion
Numpy data type conversion
2022-07-27 05:28:00 【Charleslc's blog】
List of articles
View data type :dtype
Example 1:
In[1]: a = np.arange(5)
In[2]: a.dtype
Out[1]: dtype('int32')
Example 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')
Data conversion :astype
Example 1:
In[1]: a = a.astype(np.float64)
In[1]: a.dtype
Out[1]: dtype('float64')
Example 2:
In[1]: b = b.astype(np.int32)
In[2]: b.dtype
Out[2]: dtype('int32')
边栏推荐
- B1031 查验身份证
- Use of collection framework
- Simplify the mybits framework of JDBC
- Prime number screening (Ehrlich sieve method, interval sieve method, Euler sieve method)
- B1023 组个最小数
- During its low-level period, this slave edge causes the instruction number to make a corresponding model
- SSM framework integration
- The receiver sets the concurrency and current limit
- 2021 OWASP top 5: security configuration error
- How to quickly and effectively solve the problem of database connection failure
猜你喜欢

Li Hongyi machine learning team learning punch in activity day03 --- error and gradient decline

Sparse array → saving and continuation of Gobang

Scientific Computing Library -- Matplotlib

如何快速有效解决数据库连接失败问题

实用小工具: Kotlin 代码片段

Flask的使用

JVM Part 1: memory and garbage collection part 6 -- runtime data area local method & local method stack

JVM上篇:内存与垃圾回收篇十一--执行引擎

JVM Part 1: memory and garbage collection part 7 -- runtime data area heap

Scientific Computing Library - numpy
随机推荐
Rolling Division
The receiver sets the concurrency and current limit
JVM上篇:内存与垃圾回收篇十一--执行引擎
弹球小游戏
消息可靠性处理
JVM Part 1: memory and garbage collection part 11 -- execution engine
[CSAPP] Application of bit vectors | encoding and byte ordering
Pinball games
Use of collection framework
如何快速有效解决数据库连接失败问题
redis发布订阅模式
秒杀系统设计
Li Hongyi machine learning team learning punch in activity day01 --- introduction to machine learning
辗转相除法
接收方设置并发量和限流
JVM Part 1: memory and garbage collection -- runtime data area 4 - program counter
BIO、NIO、AIO区别
How to store the startprocessinstancebykey method in acticiti in the variable table
redis事务
Derivation and explanation of PBR physical illumination calculation formula