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

Commit 6ea55de

Browse files
author
Ehsan Totoni
committed
df shift assign nan
1 parent f46efd3 commit 6ea55de

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

hpat/hiframes.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,16 @@ def _gen_column_call(self, out_var, args, col_var, func):
245245
code_obj = loc_vars['g'].__code__
246246
code_expr = ir.Expr.make_function(None, code_obj, None, None, loc)
247247
index_offsets = [0]
248-
return gen_stencil_call(col_var, out_var, code_expr, index_offsets)
248+
stencil_nodes = gen_stencil_call(col_var, out_var, code_expr, index_offsets)
249+
250+
def f(A):
251+
A[:shift_const] = np.nan
252+
f_blocks = get_inner_ir(f)
253+
remove_none_return_from_block(f_blocks[0])
254+
replace_var_names(f_blocks, {'A': out_var.name})
255+
setitem_nodes = f_blocks[0].body
256+
257+
return stencil_nodes+setitem_nodes
249258

250259
def _gen_fillna(self, out_var, args, col_var):
251260
def f(A, B, fill):

0 commit comments

Comments
 (0)