Hello,
I aim to create a visualization in Kibana that mirrors the output obtained with the following Python pandas code. Please note that while the example code is in Python, my data resides within an Elasticsearch index.
import pandas as pd
# Assuming your dataframe is named df
data = {
'a': [1, 1, 2, 2],
'b': ['positive', 'negative', 'negative', 'negative'],
'c': [5, 3, 3, 2]
}
df = pd.DataFrame(data)
# Filter rows where b is positive
positive_a = df[df['b'] == 'positive']['a']
# Filter rows where a is in positive_a
result = df[df['a'].isin(positive_a)].groupby('a')['c'].sum().reset_index()
print(result)