CopyForeignColumn / Manipulation Layer
Copy a column from second DataFrame and insert it at a specified position in first DataFrame. Similar to pandas' insert() with data from another DataFrame.
Example:
First DataFrame (destination):
id | name | score |
---|---|---|
1 | Alice | 95 |
2 | Bob | 87 |
3 | Carol | 92 |
Second DataFrame (source):
grade | status | year |
---|---|---|
A | Active | 2024 |
B | Active | 2024 |
A | Pending | 2024 |
Result (copying 'status' at index 2):
id | name | status | score |
---|---|---|---|
1 | Alice | Active | 95 |
2 | Bob | Active | 87 |
3 | Carol | Pending | 92 |
Key characteristics:
- Requires equal row counts
- Preserves row alignment
- Maintains original data type
- Supports position-based insertion
- Original columns shift right
Common applications:
- Column reorganization
- Data structure alignment
- Schema standardization
- Selective data integration
- Layout optimization
- Report formatting
- View customization
Table
0
Table
1
0
Table
Columns
[, ...]Select
columnColumn to copy from second DataFrame. Common scenarios:
- Additional attributes
- Supplementary information
- Calculated results
- Reference data
- Classification labels
AtIndex
u32Zero-based position where column should be inserted. Examples:
- 0: Insert at beginning
- 1: Insert after first column
- n: Insert after nth column
Existing columns from this position shift right
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.