Skip to Content
Keras Deep Learning Cookbook
book

Keras Deep Learning Cookbook

by Rajdeep Dua, Sujit Pal, Manpreet Singh Ghotra
October 2018
Intermediate to advanced
252 pages
6h 49m
English
Packt Publishing
Content preview from Keras Deep Learning Cookbook

Loading the dataset

  1. We define a parser to convert YY to YYYY, shown as follow:
def parser(x):     return datetime.strptime('200' + x, '%Y-%m')
  1. Next, call the read_csv function of pandas to load a .csv file into a pandas DataFrame.
Notice the data parser being used is the function defined previously.
  1. The next read_csv function is called in the next code:
series = read_csv('sales-of-shampoo-over-a-three-ye.csv', header=0, parse_dates=[0], index_col=0,                         squeeze=True, date_parser=parser)
  1. Once the series is loaded, let's summarize the first few rows:
print(series.head())

The output of the preceding code is as follows:

Month2001-01-01 266.02001-02-01 145.92001-03-01 183.12001-04-01 119.32001-05-01 180.3
  1. Next, let's print the line plot using ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Applied Deep Learning with Keras

Applied Deep Learning with Keras

Ritesh Bhagwat, Mahla Abdolahnejad, Matthew Moocarme
Advanced Deep Learning with Keras

Advanced Deep Learning with Keras

Rowel Atienza, Neeraj Verma, Valerio Maggio
The Applied TensorFlow and Keras Workshop

The Applied TensorFlow and Keras Workshop

Harveen Singh Chadha, Luis Capelo, Abhranshu Bagchi, Achint Chaudhary, Vishal Chauhan, Alexis Rutherford, Subhash Sundaravadivelu

Publisher Resources

ISBN: 9781788621755Supplemental Content