turicas / turicas/rows

Should be able to operate directly on `Table` columns

Open
#74 2 comments 0 reactions 0 assignees View on GitHub

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 Row as 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.fields is a collections.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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.