python常用命令

获取dataframe的行列数

行:
df.shape[0]   或者:len(df)

列:
df.shape[1]  

PM2.5的表示方法

'PM$_2$$_.$$_5$(μg m$^-$$^3$)'

获取array的index,然后进行替换

ws[np.argwhere((wd<90) | (wd >270))]=np.nan   ##挑出非南风,赋值为np.nan

画双y轴坐标,并设置tick的属性

axs0 = axs[0].twinx() 
line1=axs0.plot(xs,Temp,color=c,ls=ls,lw=0.8)
axs0.set_ylabel('T($^\circ$C)', color=c)  # we already handled the x-label with ax1
axs0.set_ylim(10,40)
axs0.tick_params(axis='y', labelcolor=c,color=c)

把图的上轴线和右轴线隐掉

for spine in ["top", "bottom"]:
    axs0.spines[spine].set_visible(False)
## axs0.spines[spine].set_color('None')
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容