-
Notifications
You must be signed in to change notification settings - Fork 171
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
[BUG] concatenate_columns
Ignoring null values is not available
#1164
Comments
thanks @Fu-Jie , do you mind raising a PR for this? It might be better to add an |
I haven't done PR before, but I can try it. This is my solution, what do you think? na = ['NaT','nan','<NA>']
df[new_column_name] = (
df[column_names].astype(str).replace(na,"").agg(sep.join, axis=1)
) |
3 tasks
concatenate_columns
Ignoring null values is not available
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source Code
Like this, np.nan becomes 'nan' in astype str
If change it to this, there is no problem
The text was updated successfully, but these errors were encountered: