Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading data
#1
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 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
Reply
#2
Quote:I am not sure how to start up python in the directory.
open command window: (cmder: http://cmder.net/ is best if using windows)
type:
python
you can exit interactive interpreter by typing quit()

if you need to install python, see:

windows:
https://python-forum.io/Thread-Basic-Par...ght=python
and:
https://python-forum.io/Thread-Basic-Par...ght=python

Linux:
https://python-forum.io/Thread-Basic-Par...ght=python
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Bulk loading of data using python shivamsvmsri 2 761 Sep-28-2023, 09:04 AM
Last Post: shivamsvmsri

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020