This repository was archived by the owner on Feb 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,6 +140,14 @@ def _run_assign(self, assign):
140140 assign .value = df_cols [rhs .attr ]
141141 self .df_cols .add (lhs ) # save lhs as column
142142
143+ # c = df.column.values
144+ if (rhs .op == 'getattr' and rhs .value .name in self .df_cols and
145+ rhs .attr == 'values' ):
146+ # simply return the column
147+ # output is array so it's not added to df_cols
148+ assign .value = rhs .value
149+ return [assign ]
150+
143151 # c = df.column.shift
144152 if (rhs .op == 'getattr' and rhs .value .name in self .df_cols and
145153 rhs .attr in df_col_funcs ):
Original file line number Diff line number Diff line change 66 count_parfor_OneDs , count_array_OneDs , dist_IR_contains )
77
88class TestHiFrames (unittest .TestCase ):
9+ def test_basics (self ):
10+ def test_impl (n ):
11+ df = pd .DataFrame ({'A' : np .ones (n ), 'B' : np .random .ranf (n )})
12+ Ac = df ['A' ].values
13+ return Ac .sum ()
14+
15+ hpat_func = hpat .jit (test_impl )
16+ n = 11
17+ self .assertEqual (hpat_func (n ), test_impl (n ))
18+ self .assertEqual (count_array_REPs (), 0 )
19+ self .assertEqual (count_parfor_REPs (), 0 )
20+ self .assertEqual (count_parfor_OneDs (), 1 )
21+
922 def test_cumsum (self ):
1023 def test_impl (n ):
1124 df = pd .DataFrame ({'A' : np .ones (n ), 'B' : np .random .ranf (n )})
You can’t perform that action at this time.
0 commit comments