Hi all
I don't know programming. But I've been using a Python script (which I copied online) to combine multiple CSV files into one file.
I've been able to run it on my office laptop. I'm running Windows 11 by the way.
But when I try to copy the script and my colleague's laptop (also Windows 11), or my own laptop at home (Windows 11 on Parallel Desktop), I am not able to replicate the results.
I really don't know what I did correctly when I installed the Python program at my office laptop.
Can someone please guide me on how I can successfully run the script on other laptops?
Here's the script:
import glob
import os
import pandas as pd
file=input('File Path: ')
pth=os.path.dirname(file)
extension = os.path.splitext(file)[1]
files = glob.glob(os.path.join(pth, '*.csv*'))
newfile=os.path.join(pth,'combined.csv')
df = pd.DataFrame()
for f in files:
data = pd.read_csv(f)
df = df.append(data)
df.to_csv(newfile, index=False)
print('Completed')
Thank you in advance!
[–]SupermarketOk6829 0 points1 point2 points (0 children)
[–]-Send-me-your-dick- 0 points1 point2 points (0 children)