-
Notifications
You must be signed in to change notification settings - Fork 124
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
fix: Create indices with object dtype #1084
fix: Create indices with object dtype #1084
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1084 +/- ##
=======================================
Coverage 89.75% 89.75%
=======================================
Files 63 63
Lines 7123 7123
Branches 1363 1364 +1
=======================================
Hits 6393 6393
Misses 531 531
Partials 199 199 ☔ View full report in Codecov by Sentry. |
Have resolved a few more warnings while I'm here. @adelavega I'm done working on these for now. Care to review? Happy to explain changes more in case the commit messages and comments are insufficient. |
@@ -156,7 +156,7 @@ def _transform(self, var, constraint='none', ref_level=None, sep='.'): | |||
continue | |||
name = ''.join([var.name, sep, str(lev)]) | |||
lev_data = data.copy() | |||
lev_data['amplitude'] = new_cols[lev].astype(float) |
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.
Why did we have this in the first place but is no longer necessary?
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.
get_dummies()
creates bools by default. This brought it back to float when reinserting into the dataframe. Instead, I make them floats at the beginning, since there's nothing that depends on them being bools above.
Looks good, just one question |
Pandas is currently generating
FutureWarning
s:pybids/bids/variables/variables.py
Lines 527 to 538 in 03a1af5
Debugging, the issue is that we're creating the dataframe with a
np.zeros()
, sodtype=float
, but entities and metadata may be strings, lists, etc. Usingdtype=object
resolves this.