Skip to content

Allow Triangle.drop() to drop origin levels #1055

Description

@genedan

Description

Triangle.drop() should allow for the dropping of origin levels when axis=2.

Is your feature request aligned with the scope of the package?

  • Yes, absolutely!
  • No, but it's still worth discussing.
  • N/A (this request is not a codebase enhancement).

Describe the solution you'd like, or your current workaround.

tri = cl.Triangle(
    data={
        'origin': [1985, 1985, 1985, 1986, 1986, 1987],
        'development': [1985, 1986, 1987, 1986, 1987, 1987],
        'paid': [300, 400, 500, 500, 600, 500],
    },
    origin='origin',
    development='development',
    columns=['paid'],
    cumulative=True
)
print(tri)

         12     24     36
1985  300.0  400.0  500.0
1986  500.0  600.0    NaN
1987  500.0    NaN    NaN
print(tri.drop(labels='1987', axis='2')

         12     24     36
1985  300.0  400.0  500.0
1986  500.0  600.0    NaN

Do you have any additional supporting notes?

Dropping of labels that are not the first or last origin period should not be allowed.

Would you be willing to contribute this ticket?

  • Yes, absolutely!
  • Yes, but I would like some help.
  • No.

Metadata

Metadata

Assignees

Labels

Fields

Priority

Low

Effort

Medium

Scope

Codebase

Projects

Status
Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions