Python 3.x 熊猫们放弃了在地块上展示的行列

Python 3.x 熊猫们放弃了在地块上展示的行列,python-3.x,pandas,matplotlib,indexing,scipy,Python 3.x,Pandas,Matplotlib,Indexing,Scipy,我正在做一张热图 我从一个将某些行归类为噪声的管道中获取数据,我决定得到一个包含它们的绘图和一个不包含它们的绘图 我的问题是:在没有嘈杂行的绘图中,出现了空行(与删除的行数相同) 大致代码是这样的(如果需要,我可以扩展部分,我会尽量让它保持简短)。 如果需要,我可以提供一个类似的数据公开链接 data_frame = load_df_fromh5(file) # load a data frame from the hdf5 output noisy = [..] # a list which

我正在做一张热图

我从一个将某些行归类为噪声的管道中获取数据,我决定得到一个包含它们的绘图和一个不包含它们的绘图

我的问题是:在没有嘈杂行的绘图中,出现了空行(与删除的行数相同)

大致代码是这样的(如果需要,我可以扩展部分,我会尽量让它保持简短)。 如果需要,我可以提供一个类似的数据公开链接

data_frame = load_df_fromh5(file)  # load a data frame from the hdf5 output
noisy = [..] # a list which indicate which row are vector    

# I believe the problem being here:
noisy = [i for (i, v) in enumerate(noisy) if v == 1] # make a vector which indicates which index to remove
# drop the corresponding index
df_cells_noisy = df_cells[~df_cells.index.isin(noisy)].dropna(how="any")

#I tried an alternative method:
not_noisy  = [0 if e==1 else 1 for e in noisy)
df = df[np.array(not_noisy, dtype=bool)]

# then I made a clustering using scipy
Z = hierarchy.linkage(df, method="average", metric="canberra", optimal_ordering=True)
df = df.reindex(hierarchy.leaves_list(Z))

# the I plot using the df variable 
# quit long function I believe the problem being upstream.
plot(df)
这个图很长,但我相信它工作得很好,因为问题只在并没有噪声的数据帧的情况下出现

在我看来,熊猫保留了有关删除行的信息,并将其绘制为一条空行。欢迎任何帮助

背景: 这些是拷贝数异常的单细胞数据(基因组片段拷贝数异常) 行代表个体(此处为个体细胞)列代表基因组间隔的拷贝数(香草2个(性染色体除外))