python - Can I set variable column widths in pandas? -
i've got several columns long strings of text in pandas data frame, interested in examining 1 of them. there way use along lines of pd.set_option('max_colwidth', 60) single column only, rather expanding width of columns in df?
if want change display in jupyter notebook, can use style feature. use formatting columns indicate column(s) enlarge subset parameter. html , css.
### test data df = dataframe({'text': ['foo foo foo foo foo foo foo foo', 'bar bar bar bar bar'], 'number': [1, 2]}) df.style.set_properties(subset=['text'], **{'width': '300px'}) 
Comments
Post a Comment