Issue
So, I have a pandas data frame with two fields
partition | account_list |
---|---|
1 | [id1,id2,id3,...] |
2 | [id4,id6,id5,...] |
since the list is quite long and I want to see the complete content I'm using
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.width', None)
pd.set_option('display.max_colwidth', -1)
louvain_communities.limit(tot_communities).toPandas()
nevertheless, as you can see (Jupiter I think) still truncate the column (I had to edit out the data for privacy)
Is there a way to fix this? I really need to check have the complete list, not truncated, to be shown.
Solution
max_colwidth and max_seq_items together work. Code below synthesises list with 500 items. Change the range()
and you can test however many you want.
import pandas as pd
pd.set_option("max_colwidth", None)
pd.set_option("max_seq_items", None)
pd.DataFrame([{"partition":i, "account_list":[f"id{j}" for j in range(500)]} for i in range(2)])
Answered By - Rob Raymond
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.