How to use the graphistry.pygraphistry.util.merge_two_dicts function in graphistry

To help you get started, we’ve selected a few graphistry examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github graphistry / pygraphistry / graphistry / bolt_util.py View on Github external
def bolt_graph_to_edges_dataframe(graph):
    import pandas as pd
    df = pd.DataFrame([
        util.merge_two_dicts(
            { key: value for (key, value) in relationship.items() },
            {
                relationship_id_key:    relationship.id,
                relationship_type_key:      relationship.type,           
                start_node_id_key:          relationship.start_node.id,
                end_node_id_key:     relationship.end_node.id
            }
        )
        for relationship in graph.relationships
    ])
    return stringify_neotimes(df)
github graphistry / pygraphistry / graphistry / bolt_util.py View on Github external
def bolt_graph_to_nodes_dataframe(graph):
    import pandas as pd
    df = pd.DataFrame([
        util.merge_two_dicts(
            { key: value for (key, value) in node.items() },
            util.merge_two_dicts(
                { 
                    node_id_key: node.id, 
                    node_type_key: ",".join(sorted([str(label) for label in node.labels])) 
                },
                { node_label_prefix_key + str(label): True for label in node.labels }))
        for node in graph.nodes
    ])
    return stringify_neotimes(df)
github graphistry / pygraphistry / graphistry / bolt_util.py View on Github external
def bolt_graph_to_nodes_dataframe(graph):
    import pandas as pd
    df = pd.DataFrame([
        util.merge_two_dicts(
            { key: value for (key, value) in node.items() },
            util.merge_two_dicts(
                { 
                    node_id_key: node.id, 
                    node_type_key: ",".join(sorted([str(label) for label in node.labels])) 
                },
                { node_label_prefix_key + str(label): True for label in node.labels }))
        for node in graph.nodes
    ])
    return stringify_neotimes(df)