You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I apologize in advance for not understanding Table iterators in this context, perhaps this is very readable for a developer but I am a data scientist trying to work around a problem in the Parquet.jl package.
This is a request for examples added to the documentation or help in usage.
Use Case:
I need to read files (CSV or parquet format) into a DataFrame from a partitioned file structure like the following, and add a string-type column containing "XXX" where the file path contains a pattern "column_name=XXX". I think from
I think if I pass a vector or list of FilePaths to the Tables.partitioner as in the docs example I could append a scalar column column_name with content "XXX" by extracting patterns from the data file paths. This will take many hours for me to figure out, can I get some help added to the documentation with a concrete example? Best way to learn IMO.
# example from Tables.jl docs:for tbl in Tables.partitions(Tables.partitioner(CSV.File, list_of_csv_files))
Threads.@spawnbegin
cols = Tables.columns(tbl)
# do stuff with cols --- this is where I append a column to each table (?) with content pulled from the file path.endend
The text was updated successfully, but these errors were encountered:
Sorry for the slow reply; CSV.jl now has this functionality supported without the need for Tables.partitioner. See the source keyword argument documentation here. Essentially, you can pass a directory of filenames as strings to CSV.File(files; source=files) and that will automatically generate a column where the rows of each file will have their filename as values in that new column. Hope that helps.
I apologize in advance for not understanding Table iterators in this context, perhaps this is very readable for a developer but I am a data scientist trying to work around a problem in the Parquet.jl package.
This is a request for examples added to the documentation or help in usage.
Use Case:
I need to read files (CSV or parquet format) into a DataFrame from a partitioned file structure like the following, and add a string-type column containing "XXX" where the file path contains a pattern "column_name=XXX". I think from
I think if I pass a vector or list of FilePaths to the Tables.partitioner as in the docs example I could append a scalar column
column_name
with content"XXX"
by extracting patterns from the data file paths. This will take many hours for me to figure out, can I get some help added to the documentation with a concrete example? Best way to learn IMO.The text was updated successfully, but these errors were encountered: