tamnd / tamnd/firepanda

A series name that can be absent rather than empty

Open
#599 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Mojo
Stars
1
Forks
0
PR merge metrics
PR metrics pending

Description

`Series.name` answers `""` for a column that has no name, where pandas answers `None`. The core holds a name as a `String` at `firepanda/frame/series.mojo:136` and the empty string is how it spells having none, which `PySeries.relabel`'s own docstring says out loud.

That is a small visible difference on its own and it is not renaming's fault: `Series.rename(None)` reaches the empty name through `relabel` and clears it correctly, and a column built without a name is in the same state from the start. Document 45 records it under `Series.rename` for that reason rather than as a thing rename does.

It is the same missing piece as two others, which is why it is worth one change rather than three.

**The row as a series.** Reading a row across the columns wants a series whose name is the row's label, and a label is not always a string. That blocks `xs`, `iloc[row]`, `loc[label]`, `squeeze(axis=0)` and `errors/position-out-of-bounds`, and it also wants `find_common_type` at `firepanda/dtype/logical.mojo:564`.

**The `to_frame` naming divergence.** pandas calls the column of an unnamed series `0`, the integer, and a column name here is a `String` so it is the text of it. A caller who writes `name=None` gets the same thing where pandas gives a column literally named `None`. That is registered on the compat board and closes with the same change.

So the ask is a series name that can hold something that is not a string, or hold nothing at all. Once it does, `Series.name` answers `None` for an unnamed column, `rename(None)` matches pandas exactly rather than nearly, the `to_frame` divergence can be deleted, and the row as a series is unblocked on one of its two fronts.

Part of #8.

Contributor guide

Open the contributing guide

Research direction

Start with the Series name representation at firepanda/frame/series.mojo:136 and the related type logic at firepanda/dtype/logical.mojo:564. Trace Series.name, PySeries.relabel, rename(None), unnamed-column construction, and to_frame before deciding how the broader name value should flow through row selection. Done means unnamed series expose None, rename(None) matches pandas, and the documented to_frame divergence is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.