如何更改绘图热图中单元格的大小?我需要更大的细胞
import plotly.express as px
fig1 = px.imshow(df[col],color_continuous_scale='Greens')
fig1.layout.yaxis.type = 'category'
fig1.layout.xaxis.type = 'category'
fig1.layout.yaxis.tickmode = 'linear'
fig1.layout.xaxis.tickmode = 'linear'
fig1.layout.xaxis.tickangle = 65
fig1.layout.autosize = True
fig1.layout.height = 500
fig1.layout.width = 500
fig1.show()
Run Code Online (Sandbox Code Playgroud)
结果(非常窄)
我试图通过对“组”列进行分组来获取数据框中前一行的差异值,有几个类似的问题,但我无法正常工作。
date group value
0 2020-01-01 A 808
1 2020-01-01 B 331
2 2020-01-02 A 612
3 2020-01-02 B 1391
4 2020-01-03 A 234
5 2020-01-04 A 828
6 2020-01-04 B 820
6 2020-01-05 A 1075
8 2020-01-07 B 572
9 2020-01-10 B 736
10 2020-01-10 A 1436
df.sort_values(['group','date'], inplace=True)
df['diff'] = df['value'].diff()
print(df)
date value group diff
1 2020-01-03 234 A NaN
8 2020-01-01 331 B 97.0
2 2020-01-07 572 B 241.0
9 2020-01-02 612 A 40.0
5 2020-01-10 …Run Code Online (Sandbox Code Playgroud) 只是为了测试,我有一个包含索引的 Elasticsearch 节点,例如:
服务日志-17032020 服务日志-20032020 服务日志-21032020
我正在尝试构建一个查询,用于使用 service-log-* 模式搜索所有索引。该查询与完整索引名称完美配合,我如何搜索所有索引?
index = INDEX_NAME
query_body = {
"from":0,
"size":100,
"query": {
"bool": {
"must": [
{
"match" : {
"field": "text"
}
},
{
"range": {
"@timestamp": {
"gt":str(date)
}
}
}
]
}
}
}
result = elastic_client.search(index=INDEX_NAME, body=query_body)
Run Code Online (Sandbox Code Playgroud)