assistant-dialog-flow-analysis
assistant-dialog-flow-analysis copied to clipboard
KeyError: "['path_length', 'is_conversation_start', 'flows', 'conversation_log_ids_rerouted', 'name', 'conversation_log_ids_dropped_off', 'rerouted', 'type', 'dropped_off'] not in index"
Hello,
In 4.1.3. Analyzing reverse flows , While running the below cell:
escalated_similified_reversed_df = analysis.aggregate_flows(escalated_simplified_df, mode="turn-based",\
on_column="turn_label", max_depth=30, trim_reroutes=False, reverse=True)
Getting key error as follow: KeyError: "['path_length', 'is_conversation_start', 'flows', 'conversation_log_ids_rerouted', 'name', 'conversation_log_ids_dropped_off', 'rerouted', 'type', 'dropped_off'] not in index"
Version: Python: 3.9.13 Running Env: Watson Studio Hardware configuration | 1 vCPU and 4 GB RAM Software configuration | Runtime 22.1 on Python 3.9
Detailed error:
KeyError Traceback (most recent call last)
/tmp/wsuser/ipykernel_132/3368063260.py in
3 on_column="turn_label", max_depth=30, trim_reroutes=False, reverse=True)
/opt/conda/envs/Python-3.8-Watson-NLP/lib/python3.8/site-packages/conversation_analytics_toolkit/analysis.py in aggregate_flows(df, max_depth, mode, on_column, trim_reroutes, reverse, silent_mode) 424 df_node_out.rename(columns={'index':'path'}, inplace=True) 425 --> 426 return pd.concat([df_node_out])[['path','name','type','is_conversation_start','flows','rerouted','dropped_off','conversation_log_ids_rerouted','conversation_log_ids_dropped_off','path_length']] 427 428 # def _find_consecutive_flow_states(df, column="milestone"):
/opt/conda/envs/Python-3.8-Watson-NLP/lib/python3.8/site-packages/pandas/core/frame.py in getitem(self, key) 3028 if is_iterator(key): 3029 key = list(key) -> 3030 indexer = self.loc._get_listlike_indexer(key, axis=1, raise_missing=True)[1] 3031 3032 # take() does not accept boolean indexers
/opt/conda/envs/Python-3.8-Watson-NLP/lib/python3.8/site-packages/pandas/core/indexing.py in _get_listlike_indexer(self, key, axis, raise_missing) 1264 keyarr, indexer, new_indexer = ax._reindex_non_unique(keyarr) 1265 -> 1266 self._validate_read_indexer(keyarr, indexer, axis, raise_missing=raise_missing) 1267 return keyarr, indexer 1268
/opt/conda/envs/Python-3.8-Watson-NLP/lib/python3.8/site-packages/pandas/core/indexing.py in _validate_read_indexer(self, key, indexer, axis, raise_missing) 1314 if raise_missing: 1315 not_found = list(set(key) - set(ax)) -> 1316 raise KeyError(f"{not_found} not in index") 1317 1318 not_found = key[missing_mask]
KeyError: "['path_length', 'is_conversation_start', 'flows', 'conversation_log_ids_rerouted', 'name', 'conversation_log_ids_dropped_off', 'rerouted', 'type', 'dropped_off'] not in index"
Please let me know is there any work around to fix this issue.