Skip to content
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

Add as_dataframe argument to read_csv() #421

Merged
merged 3 commits into from
Apr 25, 2024

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Apr 24, 2024

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
Copy link
Member Author

hagenw commented Apr 25, 2024

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

Copy link

codecov bot commented Apr 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
Files Coverage Δ
audformat/core/utils.py 100.0% <100.0%> (ø)

@hagenw hagenw requested review from felixbur and audeerington April 25, 2024 08:10
@audeerington
Copy link

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
Copy link
Member

i like "as_dataframe"

@hagenw hagenw changed the title Add always_return_dataframe argument to read_csv() Add als_dataframe argument to read_csv() Apr 25, 2024
@hagenw
Copy link
Member Author

hagenw commented Apr 25, 2024

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

@hagenw hagenw changed the title Add als_dataframe argument to read_csv() Add as_dataframe argument to read_csv() Apr 25, 2024
@hagenw hagenw merged commit dbc7285 into main Apr 25, 2024
10 checks passed
@hagenw hagenw deleted the read-csv-always-return-dataframe branch April 25, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants