title: Output Format in Jupyter Notebook
body: <p>I'm currently using <code>Jupyter Notebook</code> for my study purposes. I have <a href="https://www.datacamp.com/community/tutorials/pandas-tutorial-dataframe-python" rel="nofollow noreferrer">follow this guide </a> on Pandas DataFrame by <code>Datacamp</code></p>
  
  <p>I'm curious about one thing with Jupyter notebook:</p>
  
  <p><strong>I have the following segment of code</strong>: </p>
  
  <pre><code>import pandas as pd
  import numpy as np
  df = pd.DataFrame(data=np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [40, 50, 60], [23, 35, 37]]),
                index=[2.5, 12.6, 4.8, 4.8, 2.5],
                columns=[48, 49, 50])
  
  print(df)
  print('-------------------')
  
  df.reset_index().drop_duplicates(subset='index', keep='last').set_index('index')
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <p><img src="https://i.imgur.com/qgPdPlX.png" alt="output" title="output"></p>
  
  <p>I notice that my first <code>print()</code> function will return the table before the separating line. However, the line of code below, which is <code>df.reset_index().drop_duplicates(subset='index',keep='last').set_index('index')</code> will return a pretty-looking table below. </p>
  
  <p>I want to to the same thing with <code>print(df)</code> by trying to remove the whole function <code>print(df)</code> and go to a new line and type in <code>df</code>. The result is that i will be able to create the same format as shown.</p>
  
  <p><strong>However</strong>, I can't recreate the same format if I just remove the section <code>print(df)</code> and replace it with <code>df</code> in the same block of codes.</p>
  
  <p><strong>My question is</strong>:</p>
  
  <ol>
  <li>Are there any way to create the same format within the same block of code?</li>
  </ol>