我有一个数据框,其中索引值是由下划线分隔的字符串和数字的混合。
sub_int1_ICA_int2 #
Run Code Online (Sandbox Code Playgroud)
我想先使用 int1 对列索引进行排序,然后使用 int2 预期输出为:
sub_1_ICA_1
sub_1_ICA_2
sub_1_ICA_3
...........
sub_2_ICA_1
sub_2_ICA_2
...........
Run Code Online (Sandbox Code Playgroud)
正如我在许多帖子中看到的那样,我尝试使用 convert_numeric,但出现错误
X.convert_objects(convert_numeric=True).sort_values(['id] , ascending=[True], inplace=True)
>>(KeyError: 'id')
Run Code Online (Sandbox Code Playgroud)
你能帮忙的话,我会很高兴!
我想跟踪我的查询执行所需的时间我参考了 这篇文章,但我只得到了没有时间的查询.在使用我的web应用程序进行wile之后,使用select,update,insert查询(不是从控制台而是真正的web应用程序执行),我可以得到一个像SHOW PROFILES生成的输出这样的摘要; 命令.我正在使用wamp mysql V5.5.24非常感谢
编辑:我使用触发器跟踪更新和插入语句遵循此方法 我仍然有问题如何跟踪选择查询.有什么想法吗?
我有两个需要使用相同颜色条绘制的光谱图。我试图遵循以前的帖子,但我总是遇到与 imshow 相关的错误,或者在我的两个数据集之间找到最小值和最大值。到目前为止,我只是使用数据集的颜色条,它可能具有最小值和最大值(嘈杂的数据集)
NFFT = 1024
cmap = plt.get_cmap('viridis')
cmap.set_under(color='k', alpha=None)
x=noisy.as_matrix()[:,1]
z=denoised [:,1]
fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(20, 10))
values, ybins, xbins, im = ax1.specgram(x, NFFT=NFFT, cmap=cmap,
Fs=128, noverlap=900)
ax1.set(title='original')
values1, ybins1, xbins1, im1 = ax2.specgram(z, NFFT=NFFT, cmap=cmap,
Fs=128, noverlap=900)
ax2.set(title='deoised')
fig.colorbar(im, ax=ax1)
fig.colorbar(im, ax=ax2)
plt.show()
Run Code Online (Sandbox Code Playgroud)
我的问题是如何在两个光谱图之间共享颜色图以及如何找到最小值和最大值?