We want to organize the dataframe in such a way that the dates are used as the index of the dataframe. To be better prepared for operating with dates, we also want that the data import process automatically converts date strings to a pandas Timestamp object. Finally, you might have noted that the way the date is written in the data files is in the ISO-format YY-MM-DD format and not in the American MM-DD-YY or the European DD-MM-YY format. We can put on our wishlist that pandas automatically recognizes the date format and performs the correct conversion:
solarWatts = pd.read_csv("solarWatts.dat",
sep=';',
index_col='Date',
parse_dates=[0], infer_datetime_format=True)
The pandas command read_csv is the central tool. It has many more parameters than we used here and carefully studying their functionalities saves a lot of programming...