How to do it...

  1. Read in the 2016 and 2017 stock datasets, and make their ticker symbol the index:
>>> stocks_2016 = pd.read_csv('data/stocks_2016.csv',                               index_col='Symbol')>>> stocks_2017 = pd.read_csv('data/stocks_2017.csv',                              index_col='Symbol')
    
  1. Place all the stock datasets into a single list, and then call the concat function to concatenate them together:
>>> s_list = [stocks_2016, stocks_2017]>>> pd.concat(s_list)
  1. By default, the ...

Get Pandas Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.