-
Notifications
You must be signed in to change notification settings - Fork 322
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
Pandas FutureWarning: Length 1 tuple will be returned #1374
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,3 +164,8 @@ def load_data_from_csv(filepath, pandas_kwargs=None): | |
pandas_kwargs = pandas_kwargs or {} | ||
data = pd.read_csv(filepath, **pandas_kwargs) | ||
return data | ||
|
||
|
||
def groupby_list(list_to_check): | ||
"""Return the list element if the length is 1 and the list otherwise.""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would use something more descriptive as -> Return the first element of the list if the length is 1 else the entire list. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes good idea, done in 41690bd. |
||
return list_to_check[0] if len(list_to_check) == 1 else list_to_check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting here seems broken, maybe you meant to do like below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes thank you. I changed this in 1a29185.