对于每行,我想在第一个NaN出现后将所有值都设置为NaN。例如:
+-----------------+--------------+
| phone_area_code | phone_number |
+-----------------+--------------+
| 123 | 4567890 |
| 123 | 4567890 |
| 123 | 4567890 |
| 123 | 4567890 |
+-----------------+--------------+
应该变成这样:
a b c
1 2 3 4
2 nan 2 nan
3 3 nan 23
到目前为止,我只知道如何通过对每一行的每一列进行for循环来执行此操作-这非常慢!
答案 0 :(得分:5)
使用@Configuration
public class AxonConfig {
@Autowired
public void configureProcessors(EventProcessingConfigurer eventProcessingConfigurer) {
TrackingEventProcessorConfiguration tepConfig = TrackingEventProcessorConfiguration.forSingleThreadedProcessing().andInitialTrackingToken(StreamableMessageSource::createHeadToken);
eventProcessingConfigurer.registerTrackingEventProcessorConfiguration(config -> tepConfig);
}
}
cumprod