Commit 5b9f43ba authored by Bruno Padovese's avatar Bruno Padovese
Browse files

Merge branch 'fix_standardize_trim_table_argument' into 'development'

Fix standardize trim_table argument

See merge request !253
2 merge requests!264release 2.6.2,!253Fix standardize trim_table argument
Pipeline #5451 passed with stage
in 4 minutes and 18 seconds
Showing with 9 additions and 2 deletions
+9 -2
Change log
==========
**Version 2.6.2** (Month Day, Year)
* Fixed bug in :meth:`standardize <ketos.data_handling.selection_table.standardize>` where setting `trim_table=True` and `mapper=None` would give an error.
**Version 2.6.1** (June 3, 2022)
* In :meth:`AudioWriter:close <ketos.data_handling.database_interface.AudioWriter.close>` remove any existing column indices before attempting to reindex them. (Only relevant if appending to an existing database.)
......
......@@ -267,8 +267,11 @@ def standardize(table=None, path=None, sep=',', mapper=None, labels=None,
# keep only relevant columns
if trim_table:
df = trim(df, list(mapper.keys()))
if mapper is not None:
df = trim(df, list(mapper.keys()))
else:
df = trim(df)
# check that dataframe has minimum required columns
mis = missing_columns(df)
assert len(mis) == 0, 'Column(s) {0} missing from input table'.format(mis)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment