深度学习
基础
笔记
Scikit-learn
Jetson Nano配置
polygraphy应用
本文档使用 MrDoc 发布
-
+
home page
笔记
## Pandas获取行数,列数和元素总数(大小) ### pandas.DataFrame 显示行数,列数等:df.info() 获取行数:len(df) 获取列数:len(df.columns) 获取行数和列数:df.shape 获取元素总数(大小):df.size 指定index时的注意事项:如果使用set_index()方法将数据列指定为索引,则该列将从数据主体中删除(值属性),因此不会计入列数。 ### pandas.Series 获取元素总数(大小):len(s),s.size ## 使用GPU运行 1. tf.config.list_physical_devices('GPU')获取GPU信息:PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU') 得到GPU的编号为0 2. CUDA_VISIBLE_DEVICES=0 python3 main.py ## 扩维度和换维度 ### np.expand_dims (360,480)——>(1,360,380):np.expand_dims(a, axis=0) (360,480)——>(360,380,1):np.expand_dims(a, axis=-1) ### np.transpose (1,360,380)——>(360,1,380):np.transpose(a, (1,0,2)) (1,360,380)——>(360,380,1):np.transpose(a, (1,2,0))
yokay
July 24, 2023, 11:06 p.m.
转发文档
Collection documents
Last
Next
手机扫码
Copy link
手机扫一扫转发分享
Copy link
Markdown文件
share
link
type
password
Update password