8000 Redesign DataFrame structure by akharche · Pull Request #817 · IntelPython/sdc · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Redesign DataFrame structure #817

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix incrementing
  • Loading branch information
akharche committed Apr 27, 2020
commit 2712d76e0bfeb9e510b12a02b4d28d41c7c8912c
9 changes: 4 additions & 5 deletions sdc/hiframes/pd_dataframe_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,14 @@ def init_dataframe(typingctx, *args):
# The first column in each type always has 0 index
df_structure[col_name] = ColumnId(type_id, 0)
types_order.append(col_typ)
type_id += 1
else:
# Get index of column in list of types
type_id, col_indices = data_typs_map[col_typ]
type_idx, col_indices = data_typs_map[col_typ]
col_idx_list = len(col_indices)
df_structure[col_name] = ColumnId(type_id, col_idx_list)
df_structure[col_name] = ColumnId(type_idx, col_idx_list)
col_indices.append(col_id)

type_id += 1

def codegen(context, builder, signature, args):
in_tup = args[0]
data_arrs = [builder.extract_value(in_tup, i) for i in range(n_cols)]
Expand All @@ -108,7 +107,7 @@ def codegen(context, builder, signature, args):
data_list_type = [types.List(typ) for typ in types_order]

data_lists = []
for typ_id, typ in enumerate(data_typs_map.keys()):
for typ_id, typ in enumerate(types_order):
data_list_typ = context.build_list(builder, data_list_type[typ_id],
[data_arrs[data_id] for data_id in data_typs_map[typ][1]])
data_lists.append(data_list_typ)
Expand Down
0