Type error

imported csv file and place Date  as index 

after which in tired  df.loc(:4,)





output error

type error  : cannot do slice indexing on datetimeindex with these indexers [4] o ftype int

For integer-based indexing, you need to use .iloc. Also, you need to pass indexers in square brackets. 



Try this:

df.iloc[:4,]

Can refer to this document for indexing and selecting data.