Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combining Spreadsheets
#1
Hello, everyone. I am new to Python and recently I tried to write a script inside the Python shell of my Windows 11 computer, in order to combine different spreadsheets; though when I run it I receive a syntax error, and I do not know why. Your help in solving this would be appreciated. I am running Python 3.12.1; and this is the code that I wrote:

import os
import pandas as pd

data_file_folder= "C:/Users/Py/Documents/Work/Portfolio"

df= []

for file in os.listdir(data_file_folder):
if file.endswith(".xlsx"): print("Python at work {0}...".format(file))
df.append(os.path.join(data_file_folder, file), sheet_name="data"))
deanhystad write Feb-02-2024, 07:22 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
Combining Spreadsheets - by Py3_14 - Feb-02-2024, 06:21 PM
RE: Combining Spreadsheets - by deanhystad - Feb-02-2024, 07:40 PM
RE: Combining Spreadsheets - by Py3_14 - Feb-06-2024, 08:10 PM
RE: Combining Spreadsheets - by rob101 - Feb-06-2024, 09:16 PM
RE: Combining Spreadsheets - by deanhystad - Feb-07-2024, 04:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Merging spreadsheets with the same columns and extracting rows with matching entries johnbernard 3 10,707 Aug-19-2021, 03:08 PM
Last Post: johnbernard
Question How to make a 3D List of Excel Spreadsheets? chatguy 4 2,792 Jan-24-2021, 05:24 AM
Last Post: buran
  IDE with spreadsheets lewispgj 4 2,353 Mar-13-2020, 09:45 PM
Last Post: lewispgj
  opepyxl not counting rows in spreadsheets? jjartus 10 6,660 Mar-07-2020, 09:17 AM
Last Post: jjartus

Forum Jump:

User Panel Messages

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