- BNLFile.split(*args, final='files')¶
Recursively splits the current DataFile into a
*args (column index or function) – Each argument is used in turn to find key values for the files in the DataFolder
- Keyword Arguments
final (str) – Controls whether the final argument plaes the files in the DataFolder (default: “files”) or in groups (“groups”)
Stoner.Folders.DataFolder – A
Stoner.Folders.DataFolderobject containing the individual
Creates a DataFolder of DataFiles where each one contains the rows from the original object which had the same value of a given column(s) or function.
On each iteration the first argument is called. If it is a column type then rows which amtch each unique value are collated together and made into a separate file. If the argument is a callable, then it is called for each row, passing the row as a single 1D array and the return result is used to group lines together. The return value should be hashable.
Once this is done and the
Stoner.Folders.DataFolderexists, if there are remaining argument, then the method is called recusivelyt for each file and the resulting DataFolder added into the root DataFolder and the file is removed.
Thus, when all of the arguments are evaluated, the resulting DataFolder is a multi-level tree.
There has been a change in the arguments for the split function from version 0.8 of the Stoner Package.