I have a pandas DataFrame with more than 70 columns.
When I produce a calculation on it, firefox (on windows) has the DataFrame printed in a greater space than the window is allotted for it. I would like the scrollbar to fit inside the ipython window allotted for it. Is there any clean way to handle this?
It can be recreated in firefox using this code in an ipython notebook window.
df = pd.DataFrame(np.random.randn(100, 20))
df.tail()
pandas
?print
the result? I'd guess the previous one is specified byDataFrame.__repr__
and the second one byDataFrame.__str__
? But I'm no Panda expert at all...to_html()
. So what exactly is it you want to restrict the max width displayed? You can change this usingpd.set_option('display.max_width, some_val)
and alsopd.set_option('display.max_colwidth, some_val)
, see this for a list of options