当前位置:首页>python>自学Python --Day1,Numpy

自学Python --Day1,Numpy

  • 2026-10-11 07:56:33
自学Python --Day1,Numpy
在服务器中已创建了jupyter环境jupyter_env,保持jupyter的后台运行
cd /data2/hjl/jupyter/   #到jupyter根目录nohup jupyter notebook >jupyter.log &
从powershell登录服务器
ssh -L 8888:localhost:8888 xxxxx@xxxxxx

然后从本地电脑打开浏览器http://localhost:8888

今天学习了用numpy创建dataframe
import numpy as npgenes = ["GeneA","GeneB","GeneC","GeneD","GeneE"]samples= ["sample1","sample2","sample3","sample4"]np.random.seed(1212)data= np.random.randint(50,200,size=(len(genes),len(samples)))# 构造dataframedf= pd.DataFrame(data, index=genes, columns=samples)print(df)

筛选

df[df['sample1']>150] #筛选sample1表达量>150的

最新文章

随机文章