feat(dc/tool-c): Add pivot column ordering and NA handling features
Major features: 1. Pivot transformation enhancements: - Add option to keep unselected columns with 3 aggregation methods - Maintain original column order after pivot (aligned with source file) - Preserve pivot value order (first appearance order) 2. NA handling across 4 core functions: - Recode: Support keep/map/drop for NA values - Filter: Already supports is_null/not_null operators - Binning: Support keep/label/assign for NA values (fix nan display) - Conditional: Add is_null/not_null operators 3. UI improvements: - Enable column header tooltips with custom header component - Add closeable alert for 50-row preview - Fix page scrollbar issues Modified files: Python: pivot.py, recode.py, binning.py, conditional.py, main.py Backend: SessionController, QuickActionController, QuickActionService Frontend: PivotDialog, RecodeDialog, BinningDialog, ConditionalDialog, DataGrid, index Status: Ready for testing
This commit is contained in:
@@ -109,6 +109,10 @@ def apply_conditional_column(
|
||||
mask = col_data >= value
|
||||
elif operator == '<=':
|
||||
mask = col_data <= value
|
||||
elif operator == 'is_null': # ✨ 新增:为空
|
||||
mask = result[column].isna()
|
||||
elif operator == 'not_null': # ✨ 新增:不为空
|
||||
mask = result[column].notna()
|
||||
else:
|
||||
raise ValueError(f'不支持的运算符: {operator}')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user