Legacy Dev Forum Posts

 View Only

Sign Up

How to load json structur data from ConversationAggregateDataContainer into python dataframe

  • 1.  How to load json structur data from ConversationAggregateDataContainer into python dataframe

    Posted 06-05-2025 19:07

    Hansmuffs | 2022-11-14 14:11:26 UTC | #1

    Hi,

    I use this aggregation function from genesys analytics: try:

    Query for conversation aggregates

    apiresponse = apiinstance.postanalyticsconversationsaggregatesquery(body)

    print(api_response)

    except ApiException as e: print("Exception when calling PostAnalyticsConversationsAggregatesQueryRequest->postanalyticsconversationsaggregatesquery: %s\n" % e)

    list = str(api_response.results) print(list)

    But I don't know how to load the result from the list object into a dataframe:

    This is my result string: {'results': [{'data': [{'interval': '2022-11-11T10:00:00.000Z/2022-11-11T10:30:00.000Z', 'metrics': [{'metric': 'nError', 'qualifier': None, 'stats': {'count': 4, 'countnegative': None, 'countpositive': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': None, 'target': None}}, {'metric': 'nOffered', 'qualifier': None, 'stats': {'count': 113, 'countnegative': None, 'countpositive': None, 'current': None, 'denominator': None, 'max': None, 'min': None, 'numerator': None, 'ratio': None, 'sum': None, 'target': None}}], 'views': None}], 'group': {'mediaType': 'voice'}}]}

    And i just need this dataframe: Dataframe: interval metric count 0 2022-11-11T10:00:00.000Z/2022-11-11T10:30:00.000Z nError 4 1 2022-11-11T10:00:00.000Z/2022-11-11T10:30:00.000Z nOffered 113

    Any Idea how to get this result?


    system | 2022-12-14 14:11:27 UTC | #2

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 17199