-
Notifications
You must be signed in to change notification settings - Fork 368
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
define Missings.replace method #1377
Comments
|
The |
Well, the idea is that we have |
This sounds reasonable. Perhaps a method for Base.replace(df::AbstractDataFrame, pat => value) then? AFAICT that is not required to be lazy. |
Yeah, but currently we don't implement any methods to apply an operation to all columns, you need to do that manually. If we start doing that, why not also implement |
I am not sure I understand, I think of dataframes as collections, so I would not broadcast
I agree, but currently it is somewhat convoluted to do some simple operations. Cf R, > df = data.frame(a = c(NA, 1), b = c(2, NA))
> df[is.na(df)] = 0
> df
a b
1 0 2
2 1 0 |
The problem is that data frames can be seen either as collections of scalars, as collections of rows or as collections of columns. Currently we don't assume people want to treat them as collections of scalars. If we changed that, we would need a consistent approach, making data frames more similar to matrices for all relevant functions (e.g. |
One can currently write:
maybe it is not the most friendly, but I guess it should be good enough? |
Do you think we could allow |
I have considered this option before writing the
So if we wanted to add it we should define:
and |
In light of this discussion and similar ones, it may make sense to define something along the lines of
The text was updated successfully, but these errors were encountered: