title: How to Filter Year Data from Year column and make every year data a new Dataset from a single dataset
body: <p>Here i don't understand how can i filter year and make every year data a new dataset from a single dataset.
  My Dataset is -
  <a href="https://i.stack.imgur.com/qjO7M.png" rel="nofollow noreferrer">Dataset</a></p>
  <p>In this dataset, 2010 to 2020 (11 years) data is available.</p>
  <p>And I need this dataset in this format-
  <a href="https://i.stack.imgur.com/BPbyq.png" rel="nofollow noreferrer">Output image. 2010 dataset</a></p>
  <p><a href="https://i.stack.imgur.com/MfVSS.png" rel="nofollow noreferrer">2011 Dataset</a></p>
  <p>So My output should be look like this in format.</p>
  <pre><code>path = r&quot;C:\Users\krishna gupta\Downloads\Diwali\temp&quot;
  files = os.listdir(path)
  b=[]
  for file in files:
      df = pd.read_csv(path+'\\'+file)
      df = df[df['SYMBOL'] == 'NIFTY']
      df = df[df['INSTRUMENT'] == 'FUTIDX']
      df['RANGE'] = df['HIGH'] - df['LOW']
      df['YEAR'] = df.TIMESTAMP.str[-4:]
  #     df = (df.iloc[0])
  #     display(df)
      b.append(df)
  df = pd.concat(b)
  df = df.sort_values(['YEAR','TIMESTAMP'])
  df.reset_index(inplace=True)
  del df['index']
  df = df[df['YEAR'] == '2011']
  df.head(5)
  </code></pre>
  <p>This is my code, And <code>df = df[df['YEAR'] == '2011']</code> here I can filter data this way, but I want to print the data frame by itself.</p>
  <p>And I'm really sorry in advance if I'm not writing my question in the right format because I'm new on StackOverflow. and thanks in advance.</p>