2

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)

enter image description here

Is there a way to fix this? I really need to check have the complete list, not truncated, to be shown.

1 Answer 1

3

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)]) 
Sign up to request clarification or add additional context in comments.

2 Comments

How long is your output? Because my columns are of more than 8k characters.
it's in the code ... I've updated the answer, it your list is > 100 items you need to set max_seq_items as well

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.