Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a script to get the most commonly asked questions? #10

Open
FrozenHearth opened this issue Nov 5, 2022 · 0 comments
Open

Is there a script to get the most commonly asked questions? #10

FrozenHearth opened this issue Nov 5, 2022 · 0 comments

Comments

@FrozenHearth
Copy link

There are around 537 CSVs in the repo. I got a script to combine all the CSVs, but it was a huge mess, because the combined CSV file was 31 mb, and the formatting was all messed up. Basically, I wanted to create a CSV to order by the most frequently asked questions from all these companies.

import os
import glob
import pandas as pd
os.chdir('/mydir')

#find all csv files in the folder
#use glob pattern matching -> extension = 'csv'
#save result in list -> all_filenames
extension = 'csv'
all_filenames = [i for i in glob.glob('*.{}'.format(extension))]
#print(all_filenames)

#combine all files in the list
combined_csv = pd.concat([pd.read_csv(f) for f in all_filenames], axis=1)
#export to csv
combined_csv.to_csv( "aaaaa.csv", index=False, encoding='utf-8-sig')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant