Category : readfile

I am trying to read an excel file into a dataframe using pandas and jupyter notebook from subfolder on my desktop. The file is on my desktop in a folder called ‘Data’, subfolder ‘KN-Data’, subfolder ‘New-Files’, file name "Customers.xlsx". Here is the code I am trying: df_customers = pd.read_excel (r"C:/Users/Zach/Desktop/Data/KN-Data/New-Files/Customers.xlsx") Error is [Errno 2] No ..

Read more

I ran the following code in Python: def translateDesc(fileName): textFile = open("fileName", "r") fileLines = textFile.readlines() return fileLines And the function returns an empty string. However, when I ran the lines one by one in the iPython terminals, the function returned was not empty. How should I fix this issue? Source: Python..

Read more