-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Feature request: read_csv/read_table/read_fwf - read multiple files with the same structure, applying the same parameters (skiprows
, skipfooter
, nrows
)
#12618
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
Comments
None of the
|
@jreback, @TomAugspurger Hello, I could add support for reading from multiple files, be it file list or wildcard support. Although this is syntactic sugar, but maintaining it is not worth a lot of effort, and will save users from boilerplate code. What do you think? |
it would be a good feature however error handling would have to be very obvious would likely want to extend to other read_* functions so ideally it's a somewhat generic soln pls open a new issue for discussions |
Hello,
I think it would make sense to make
read_csv()
,read_table()
,read_fwf()
able to read multiple files with the same structure. It might be tricky to read multiple files into one string, especially when all of them have header line(s) and when you want to use the following parameters:skiprows
,skipfooter
,nrows
.The logic for (
skiprows
,skipfooter
,nrows
) is already implemented, so IMO it shouldn't be very difficult. Theheader
parameter (if header exists) must be read/parsed only from the first (from one) file.Of course one can always do something like:
df = pd.concat([pd.read_csv(f, **kwargs) for f in flist], ignore_index=True)
but it's not very efficient when working with big files.
In the last days there were plenty of similar questions stackoverflow.com, asking how to merge CSV files with the same structure.
Thank you!
The text was updated successfully, but these errors were encountered: