-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Describe the solution you'd like
Add new top-level function into ndframe.py - piso.from_frame
It allows fast creation of interval arrays from vector data in dataframes
Additional context
sig:
def from_frame(frame, start, end, group=None, index=False)
- frame is pandas.DataFrame
- start, end, group all strings
- index is boolean and indicate is IntervalIndex, or IntervalArray should be produced.
import piso
df = pd.DataFrame(
{
"group";["A", "B", "A", "B"],
"start":[1,3,5,7],
"end":[2,4,6,8],
}
)
piso.from_frame(df, "start", "end", "group")
# produces Series, indexed by "group", where values are interval arrays of type indicated by "index" paramMetadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers