79075953

Date: 2024-10-10 19:56:01
Score: 1.5
Natty:
Report link

Thanks to @ouroboros1 for the solution, full code to follow!

def main():

    csvFileList=os.listdir("data")

    dataFileList={}

    for csvFile in csvFileList:

        with open(f"data\\{csvFile}", mode='r', newline='\n') as curFile:
            curFileData = csv.reader(curFile)
            currFileList=[]
            for row in curFileData:
                currFileList.append(row)
            dataFileList[csvFile]= currFileList
    pandaList=[]

    for file in dataFileList:
        pandaList.append((file, pd.DataFrame(dataFileList[file][1:], columns=dataFileList[file][0])))

    for df in pandaList:

        filename = df[0]
        dataFrame=df[1]
        result = dataFrame.loc[:, dataFrame.nunique().ne(1)]

        result.to_csv(filename, index=False)
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @ouroboros1
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: MKUltra