当前位置:网站首页>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')
边栏推荐
猜你喜欢

Sunyanfang, co-founder of WeiMiao: take compliance as the first essence and become the "regular army" of financial and business education

Critical path principle

idea远程调试debug

Scientific Computing Library -- Matplotlib

探寻通用奥特能平台安全、智能、性能的奥秘!

简化JDBC的MyBits框架

数据库连接池&&Druid使用

ssm框架整合

Typescript details

2021 OWASP top 5: security configuration error
随机推荐
Demo of throttling function -- regular expression matching
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
B1028 人口普查
JVM Part 1: memory and garbage collection part 14 -- garbage collector
素数筛选(埃氏筛法,区间筛法,欧拉筛法)
集合框架的使用
Bean's life cycle & dependency injection * dependency auto assembly
Select user stories | the false positive rate of hole state in jushuitan is almost 0. How to do this?
如何快速有效解决数据库连接失败问题
Bean的生命周期&&依赖注入*依赖自动装配
Detailed description of polymorphism
消息可靠性处理
JVM上篇:内存与垃圾回收篇二--类加载子系统
The project connects with Alipay payment, and the intranet penetration realizes the monitoring of asynchronous callback notification of successful payment of Alipay
辗转相除法
35.滚动 scroll
Solution and principle analysis of feign call missing request header
JVM Part 1: memory and garbage collection part 5 -- runtime data area virtual machine stack
数据库连接池&&Druid使用
B1021 single digit statistics