![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习
小戴是新手呀
这个作者很懒,什么都没留下…
展开
-
python中 数字变成字符串,字符串变成数字
1)数字变成字符串 函数:str() 举例: a=10 str(a) print(type(a)) print(type(str(a))) 结果: <class ‘int’> <class ‘str’> 2)字符串变数字 变整数时:int() 变浮点数:foat() 举例: a='5' b=int(a) print(type(b)) 结果: <class ‘int’> c='1.22' d=float(b) print(type(d)) 结果: <class ‘fl原创 2020-07-02 21:00:39 · 2493 阅读 · 2 评论 -
Python学习之numpy(一)
import numpy as np '''1.1.1数组的创建''' a=np.array([1,2,3,4,5]) #数组创建的三种方法 b=np.array(range(1,6)) c=np.arange(1,6) print(a) print(b) print(c) print(a.dtype) #显示数据的类型 d=np.array(range(1,6),dtype=float) #修改默认的数据类型 e=np.array(r原创 2020-06-13 16:45:25 · 103 阅读 · 0 评论