ipysigma icon indicating copy to clipboard operation
ipysigma copied to clipboard

TypeError: Object of type int64 is not JSON serializable

Open bmaz opened this issue 1 year ago • 1 comments

Oops I used pandas

import pandas as pd

table = pd.read_csv(file)

graph = table_to_bipartite_graph(
    table, 
    first_part_col="nom", 
    second_part_col="mentions", 
    first_part_data=["sexe", "twitter_description", "twitter_followers"]
)
Sigma(graph, node_color="part", node_size="twitter_followers").to_html("graph.html")

TypeError: Object of type int64 is not JSON serializable

bmaz avatar Oct 13 '23 14:10 bmaz

I propose to cast int64 as serializable JSON ints if they don't exceed 53 bits. Else, we should raise an error explaining those values should be cast to string instead.

Yomguithereal avatar Oct 16 '23 08:10 Yomguithereal