【发布时间】:2020-07-28 11:01:07
【问题描述】:
我有一个我命名为 entries 的 pandas 数据框列表,我想在从同一单元格运行代码后将其可视化。以下是我使用的代码:
alt.data_transformers.disable_max_rows()
for entry in entries :
entry['ds'] = entry.index
entry['y'] = entry['count']
entry['floor'] = 0
serie = alt.Chart(entry).mark_line(size=2, opacity=0.7, color = 'Black').encode(
x=alt.X('ds:T', title ='date'),
y='y'
).interactive().properties(
title='Evolution of '+entry.event.iloc[0]+' events over time'
)
alt.layer(serie)\
.properties(width=870, height=450)\
.configure_title(fontSize=20)
当我在“for”循环之外运行相同的代码时,我会看到与一个数据帧相对应的一个图表,但是一旦我运行上面的代码,我根本就看不到任何图表。
有谁知道为什么它不起作用或如何解决这个问题?
【问题讨论】: