Replace NaN values with values based on same group and other group?
Mostrar comentarios más antiguos
- table (650,000x20)
- customerID group
- cost group (NaN values throughout)
The table contains 5-7 data lines for each customerID that have the same cost except for one or two NaN cost values. It is obvious to replace the NaN values with the same other given cost values associated with the ID. But I am having trouble.
I was thinking:
Table.cost(isnan(Table.cost)) = Table.customerID(mode(Train.cost));
But this would apply to the entire rather than correct customerID?
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 13 de Sept. de 2016
0 votos
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!