由于我正在绘制的内容的性质,我希望子图类似于嵌套表.我不确定如何清楚地问这个问题,所以我会添加一些图片,我希望能说明这个问题.
是)我有的:

我想要的是:

当前(缩短的)代码看起来像这样:
fig, axes = plt.subplots(nrows=5, ncols=4)
fig.suptitle(title, fontsize='x-large')
data0.plot(x=data0.x, y=data0.y, ax=axes[0,0],kind='scatter')
data1.plot(x=data1.x, y=data1.y, ax=axes[0,1],kind='scatter')
axes[0,0].set_title('title 0')
axes[0,1].set_title('title 1')
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚如何一起设置轴[0,0]和[0,1]的标题.我在文档中也找不到任何内容.我不喜欢用乳胶桌来解决这个问题.有什么指针吗?
抱歉,如果之前有人问过,我找不到任何东西,尤其是因为我不确定如何命名问题!
I have a dataframe of 2000 rows and 500 columns. I want to sort every column in ascending order. The columns don't have names they're just numbered 0-500.
Random data:
df = pandas.DataFrame(np.random.randint(0,100,size=(2000, 500)), columns=range(500))
Using
df.sort_values(by=0,axis=0) sorts the 0th column, as expected. But then using df.sort_values(by=1,axis=0) sorts the 1st column but shuffles the 0th column again. In other words, I want
index 0 1 2
1 5 5 5
2 6 7 5
3 7 9 8
Run Code Online (Sandbox Code Playgroud)
But I …