audeering / audformat

Format to store media files and annotations
https://audeering.github.io/audformat/
Other
11 stars 1 forks source link

Add as_dataframe argument to read_csv() #421

Closed hagenw closed 6 months ago

hagenw commented 6 months ago

Relates to #420

This adds the as_dataframe argument to audformat.utils.read_csv(), to have the option to enforce that always a dataframe is returned. The pull request also enhances the documentation of the default behavior, which returns a series if the CSV file holds one column, and an index if the CSV file contains 0 data columns.

image

hagenw commented 6 months ago

The name always_return_dataframe seems a little bit long to me, do you have some better suggestions we could use instead?

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.0%. Comparing base (7b6b683) to head (472bddc).

Additional details and impacted files | [Files](https://app.codecov.io/gh/audeering/audformat/pull/421?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=audeering) | Coverage Δ | | |---|---|---| | [audformat/core/utils.py](https://app.codecov.io/gh/audeering/audformat/pull/421?src=pr&el=tree&filepath=audformat%2Fcore%2Futils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=audeering#diff-YXVkZm9ybWF0L2NvcmUvdXRpbHMucHk=) | `100.0% <100.0%> (ø)` | |
audeerington commented 6 months ago

Cool, seems like a useful option to have!

The name always_return_dataframe seems a little bit long to me, do you have some better suggestions we could use instead?

Maybe return_dataframe or as_dataframe?

felixbur commented 6 months ago

i like "as_dataframe"

hagenw commented 6 months ago

I changed the argument name to as_dataframe and updated the description of the pull request accordingly.