UPDATED CODE:
file_name2 =r'C:\Users\Trading\Desktop\scott\initialTrades.csv'
df=pd.read_excel(file_name2)
print (df)
This returns error XLRDError.
file_name2 =r'C:\Users\Trading\Desktop\scott\initialTrades.xlsx'
df=pd.read_excel(file_name2)
print (df)
This returns error: FileNotFoundError.
file_name ='C:\Users\Trading\Desktop\scott' file_double="C:\Users\Trading\Desktop\scott"
I put two \ instead of \ as python replace single backslash with double backslash this article states to ger rid of the (unicode error) 'unicodeescape'
What small step am I missing?
Here is the rest of my code:
sheet =initialTrades #I also tried 'initialTrades'
df = pd.read_excel(io=file_double, sheet_name=sheet)
print(df.head(5)) # print first 5 rows of the dataframe