0

For example, in the same cell, I want to output both the table and the histogram:

df.sort('speed',ascending=False).head(20)
bins=np.arange(-15, 15 + 1, 1)
df['incre'].hist(bins=bins)

But the table won't be outputed. I change it into:

print df.sort('speed',ascending=False).head(20)
bins=np.arange(-15, 15 + 1, 1)
df['incre'].hist(bins=bins)

It can return the table and the histogram, but the style of the table is lost: enter image description here

So, how can I output multiple result without losing their style?

4
  • Have you tried moving df.sort('speed',ascending=False).head(20) to be the last statement? Commented Sep 2, 2015 at 8:13
  • @EdChum, that certainly works, but what if I want to output 2 tables? Commented Sep 2, 2015 at 8:43
  • 1
    you may want to look at: stackoverflow.com/questions/21207990/… Commented Sep 2, 2015 at 8:45
  • Yeah, have a look at IPython.display.display() function Commented Sep 2, 2015 at 12:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.