Should be able to operate directly on `Table` columns
Open
Nobody has claimed this yet.
enhancement
question
rows.table
- Dominant language
- Python
- Stars
- 886
- Forks
- 137
- PR merge metrics
- No merged PRs in 30d
Description
Should be able to:
- Add/modify a column using a list of values. Example:
table['new_column'] = [i ** 2 for i in range(len(table))](assert len(new_column_values) == len(table)). - Add/modify a column using a function which receives
Rowas parameter. Example:table['new_column'] = lambda row: row.some_value ** 3. - Provide a method to add/modify a column so we can insert it in the desired position (
Table.fieldsis acollections.OrderedDict). - Delete a column. Example:
del table['some_column']
Questions:
- What to do about the new field type in case of adding/modifying using list of values/function? Options: 1- simply auto detect (involves more processment); 2- list of values or function returns instance of type (overkill); 3- use a tuple to associate the new column (example:
table['new_column'] = rows.fields.IntegerField, [i ** 2 for i in range(len(table))]).
Related to #60.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Table and Row APIs, especially Table.fields, and review related issue #60. Define how list- and function-based column updates should handle field types and ordering, then verify that adding, modifying, inserting, and deleting columns meet the requested examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100