Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
1.1 kB
1
Indexable
Never
anomalies = df_anomaly[df_anomaly['anomaly'] == -1]
anomalies.info()
anomalies.groupby('client_inn_dil')[['label','anomaly']].agg({'MO_dealer_monthly_ton_GZPN':'sum',
                                           'KP_dealer_monthly_ton_GZPN':'sum',
                                           'total_monthly_ton_dil':'sum'})

<class 'pandas.core.frame.DataFrame'>
Int64Index: 811 entries, 3 to 81311
Data columns (total 6 columns):
 #   Column                      Non-Null Count  Dtype  
---  ------                      --------------  -----  
 0   MO_dealer_monthly_ton_GZPN  811 non-null    float64
 1   KP_dealer_monthly_ton_GZPN  811 non-null    float64
 2   total_monthly_ton_dil       811 non-null    float64
 3   label                       811 non-null    object 
 4   client_inn_dil              811 non-null    object 
 5   anomaly                     811 non-null    int64  
dtypes: float64(3), int64(1), object(2)
memory usage: 44.4+ KB

KeyError: "Column(s) ['KP_dealer_monthly_ton_GZPN', 'MO_dealer_monthly_ton_GZPN', 'total_monthly_ton_dil'] do not exist"
Leave a Comment