def get_data(data):
data = data.iloc[:, 1:-1]
data_end = pd.DataFrame()
for i in range(data.shape[1]):
dfs = pd.DataFrame(data.iloc[:, i].values, columns=['数据'])
dfs['label'] = np.tile(i + 1, len(dfs)).tolist()
dfs.columns = ['数据', '编号']
data_end = pd.concat([data_end, dfs], axis=0)
data_end = data_end.reset_index(drop=True)
return data_end
from bokeh.layouts import column
from bokeh.plotting import figure, show
from bokeh.transform import jitter
def show_val(data1, data2, t1, t2):
xs = sorted(data1.编号.unique()) # x 轴刻度
p1 = figure(width=1500, height=500, title=t1)
p1.xgrid.grid_line_color = None
p1.xaxis.ticker = xs
p1.scatter(x=jitter('编号', width=1.0), y='数据', size=2, alpha=0.3, source=data1)
xs = sorted(data2.编号.unique()) # x 轴刻度
p2 = figure( width=1500, height=500, title=t2)
p2.xgrid.grid_line_color = None
p2.xaxis.ticker = xs
p2.scatter(x=jitter('编号', width=1.0), y='数据', size=2, alpha=0.6, source=data2)
show(column(p1, p2))
————————————————
版权声明:本文为CSDN博主「青梦&心河」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_43771999/article/details/122078488
数据合并+可视化
最新推荐文章于 2023-07-31 19:38:45 发布