title: how to print multiple columns as a data frame - python
body: <p>I need to print 2 specific columns as a data frame and not a series.</p>
  <p>this question is different from
  when df1 is printed it returns a series. movie title and movie year are the columns I need to print. I used the df = my_series.to_frame()
  function but it still returns a series.</p>
  <pre><code>def find_movie_by_year():
      x = input(&quot;enter movie year&quot;)
      d = df[df[&quot;title_year&quot;] == int(x)]
      df1 = d[[&quot;movie_title&quot;,&quot;title_year&quot;]]
      print('''
  
      ''')
      print(df1)
  </code></pre>
  <p>EDIT 1:</p>
  <p>this is the output format i need:</p>
  <p><a href="https://i.stack.imgur.com/6RSLd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6RSLd.png" alt="enter image description here" /></a></p>
  <p>this is the output format i get from the code:</p>
  <p><a href="https://i.stack.imgur.com/tZuKg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tZuKg.png" alt="enter image description here" /></a></p>