Loading the dataset

Loading our dataset from disk is a fairly straightforward endeavor. As we previously mentioned, we will be slicing our data by date. To do this, we will need to convert the Unix epoch times in the dataset to more sliceable dates. This is easily accomplished with the pandas to_datetime() method, as shown in the following code:

def read_data():    df = pd.read_csv("./data/bitcoin.csv")    df["Time"] = pd.to_datetime(df.Timestamp, unit='s')    df.index = df.Time    df = df.drop(["Time", "Timestamp"], axis=1)    return df

Get Deep Learning Quick Reference 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.