-
Notifications
You must be signed in to change notification settings - Fork 97
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
Adding check process to alignment at apply pars time #422
Conversation
fix for line_terminator set indexer fix removed moouu tests starting to fix applys with np functions ugh more apply ufunc fixes more apply ufunc fixes more apply ufunc fixes more pandas bs more fixes ugh more more fixes more more less reals for py3.9 mem issue
Looks like issues are less related to the use of ufunc (e.g. np.log10) on Object type series (which has be deprecated since before Pandas 1.5) but rather related to assignments with `df.loc[:,col] = RHS` casting RHS into the dtype of `df[col]` and, therefore, when RHS is expected to update the series dtype (e.g. to float or int [using apply() or astype()]) the action does nothing. Conversion of pst data cols was not occuring as expected and subsequent ufunc calls (e.g. log10) were failing. A big WTF but seems to work if the assignment is of the form `df[col]=RHS`. Have stripped back most of JTW mods after making this change in pst_handler.py
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.
Looks good to me. I think having this check will help identify bugs sooner...
@@ -968,7 +968,7 @@ def _par_prep( | |||
sep = " " | |||
if rel_filepath.suffix.lower() == ".csv": | |||
sep = "," | |||
if df.columns.is_integer(): | |||
if pd.api.types.is_integer_dtype(df.columns): # df.columns.is_integer(): # really!??? |
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.
yikes!
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.
vile ey?
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.
Adding additional data store during add pars and checking against as apply pars time.
Hopefully should catch misalignment of
index_cols
when applying pars.Caveat: might cause unexpected failures... may need refining.