If you want to made it independent from your current directory try
os.path.join(os.path.dirname(__file__), '../data/mydata.xls')
The special variable __file__
contains a relative path to the script in which it's used. Keep in mind that __file__
is undefined when using the REPL interpreter.