Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
719 B
1
Indexable
Never
import pandas as pd
import plotly.graph_objs as go
from plotly.offline import iplot

# Фильтруем df для 'dil_MO' и 'dil_MO+KP' и агрегируем данные
mo_filtered_df = df[(df['label'] == 'dil_MO') | (df['label'] == 'dil_MO+KP')]
mo_grouped = mo_filtered_df.groupby('transaction_date')['MO_dealer_monthly_ton_GZPN'].sum().reset_index()

# Создаем график
trace_mo = go.Scatter(x=mo_grouped['transaction_date'], y=mo_grouped['MO_dealer_monthly_ton_GZPN'], mode='lines+markers', name='MO Volume')

layout = go.Layout(title='MO Dealer Monthly Volume', xaxis=dict(title='Transaction Date'), yaxis=dict(title='Volume (GZPN)'))

fig = go.Figure(data=[trace_mo], layout=layout)
iplot(fig)
Leave a Comment