Jul-30-2018, 10:57 AM
Hi,
I am new to python and I am trying to load my data in excel to python. I read that one way to import data is to navigate to the directory where the file is saved and then start up python. I tried doing this but I am not sure how to start up python in the directory. I also read that if you have already started the python session, you can issue the following command:
# Import
import os
# Retrieve current working directory (
cwd = os.getcwd()
cwd
# Change directory
os.chdir("/path/to/your/folder")
# List all files and directories in current directory
os.listdir('.')
I tried this option as well but I had an error message saying that the file cannot be traced. I wanted to ask if anyone can assist me in loading my data into python please? The data is saved as an excel document in a directory on my computer.
Thank you
I am new to python and I am trying to load my data in excel to python. I read that one way to import data is to navigate to the directory where the file is saved and then start up python. I tried doing this but I am not sure how to start up python in the directory. I also read that if you have already started the python session, you can issue the following command:
# Import
os
import os
# Retrieve current working directory (
cwd
)cwd = os.getcwd()
cwd
# Change directory
os.chdir("/path/to/your/folder")
# List all files and directories in current directory
os.listdir('.')
I tried this option as well but I had an error message saying that the file cannot be traced. I wanted to ask if anyone can assist me in loading my data into python please? The data is saved as an excel document in a directory on my computer.
Thank you