Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4a45fa8
Turn on Azure CI for branch (#822)
akharche Apr 29, 2020
efb0c64
Redesign DataFrame structure (#817)
akharche Apr 30, 2020
682f5fc
Merge master (#840)
akharche May 15, 2020
c06c349
Re-implement df.getitem based on new structure (#845)
densmirn May 19, 2020
a5ee489
Re-implement df.values based on new structure (#846)
densmirn May 20, 2020
f5dcbc1
Re-implement df.pct_change based on new structure (#847)
densmirn May 20, 2020
645b284
Re-implement df.drop based on new structure (#848)
densmirn May 20, 2020
cb33e1e
Re-implement df.append based on new structure (#857)
densmirn May 22, 2020
ebb66e8
Re-implement df.reset_index based on new structure (#849)
densmirn May 22, 2020
401313c
Re-implement df._set_column based on new strcture (#850)
densmirn May 22, 2020
85f6e15
Re-implement df.rolling methods based on new structure (#852)
densmirn May 22, 2020
02d56d0
Re-implement df.index based on new structure (#853)
densmirn May 22, 2020
1f00705
Re-implement df.copy based on new structure (#854)
densmirn May 22, 2020
7bd330a
Re-implement df.isna based on new structure (#856)
densmirn May 22, 2020
7c8c8a3
Re-implement df.at/iat/loc/iloc based on new structure (#858)
densmirn May 22, 2020
693d893
Re-implement df.head based on new structure (#855)
densmirn May 25, 2020
3998b13
Re-implement df.groupby methods based on new structure (#859)
densmirn May 26, 2020
b5221f0
Re-implement dataframe boxing based on new structure (#861)
densmirn May 28, 2020
d780d38
Re-implement DataFrame unboxing (#860)
akharche May 29, 2020
d55933c
Fix rolling (#865)
akharche May 29, 2020
987521f
Undecorate tests on reading CSV (#866)
densmirn May 29, 2020
9b7c990
Re-implement df structure: enable rolling tests that pass (#867)
akharche May 29, 2020
46c1212
Re-implement df structure: refactor len (#868)
akharche May 29, 2020
8249bbc
Merge master to feature/dataframe_model_refactoring (#869)
densmirn May 29, 2020
73e66ad
Merge branch 'master' of https://github.com/IntelPython/sdc into merg…
densmirn May 30, 2020
b694a07
Enable CI on master
densmirn May 30, 2020
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
Re-implement df._set_column based on new strcture (#850)
  • Loading branch information
densmirn authored May 22, 2020
commit 401313cbe471f632ff3093c32ed96820cc23dd24
8 changes: 6 additions & 2 deletions sdc/datatypes/hpat_pandas_dataframe_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2615,9 +2615,11 @@ def df_add_column_codelines(self, key):

results = []
for i, col in enumerate(self.columns):
col_loc = self.column_loc[col]
type_id, col_id = col_loc.type_id, col_loc.col_id
res_data = f'res_data_{i}'
func_lines += [
f' data_{i} = self._data[{i}]',
f' data_{i} = self._data[{type_id}][{col_id}]',
f' {res_data} = pandas.Series(data_{i}, index=res_index, name="{col}")',
]
results.append((col, res_data))
Expand All @@ -2643,7 +2645,9 @@ def df_replace_column_codelines(self, key):
if literal_key == col:
func_lines += [f' data_{i} = value']
else:
func_lines += [f' data_{i} = self._data[{i}]']
col_loc = self.column_loc[col]
type_id, col_id = col_loc.type_id, col_loc.col_id
func_lines += [f' data_{i} = self._data[{type_id}][{col_id}]']

res_data = f'res_data_{i}'
func_lines += [
Expand Down
12 changes: 6 additions & 6 deletions sdc/tests/test_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,21 +638,21 @@ def test_impl(df, key, value):
msg = 'Could not set item for DataFrame with empty columns'
self.assertIn(msg, str(raises.exception))

@dfRefactoringNotImplemented
@dfRefactoringNotImplemented # required re-implementing DataFrame unboxing
def test_df_add_column(self):
all_data = [{'A': [0, 1, 2], 'C': [0., np.nan, np.inf]}, {}]
key, value = 'B', np.array([1., -1., 0.])

self._test_df_set_column(all_data, key, value)

@dfRefactoringNotImplemented
@dfRefactoringNotImplemented # required re-implementing DataFrame unboxing
def test_df_add_column_str(self):
all_data = [{'A': [0, 1, 2], 'C': [0., np.nan, np.inf]}, {}]
key, value = 'B', pd.Series(test_global_input_data_unicode_kind4)

self._test_df_set_column(all_data, key, value)

@dfRefactoringNotImplemented
@dfRefactoringNotImplemented # required re-implementing DataFrame unboxing
def test_df_add_column_exception_invalid_length(self):
df = pd.DataFrame({'A': [0, 1, 2], 'C': [3., 4., 5.]})
key, value = 'B', np.array([1., np.nan, -1., 0.])
Expand All @@ -661,21 +661,21 @@ def test_df_add_column_exception_invalid_length(self):
df = pd.DataFrame({'A': []})
self._test_df_set_column_exception_empty_columns(df, key, value)

@dfRefactoringNotImplemented
@dfRefactoringNotImplemented # required re-implementing DataFrame unboxing
def test_df_replace_column(self):
all_data = [{'A': [0, 1, 2], 'C': [0., np.nan, np.inf]}]
key, value = 'A', np.array([1., -1., 0.])

self._test_df_set_column(all_data, key, value)

@dfRefactoringNotImplemented
@dfRefactoringNotImplemented # required re-implementing DataFrame unboxing
def test_df_replace_column_str(self):
all_data = [{'A': [0, 1, 2], 'C': [0., np.nan, np.inf]}]
key, value = 'A', pd.Series(test_global_input_data_unicode_kind4)

self._test_df_set_column(all_data, key, value)

@dfRefactoringNotImplemented
@dfRefactoringNotImplemented # required re-implementing DataFrame unboxing
def test_df_replace_column_exception_invalid_length(self):
df = pd.DataFrame({'A': [0, 1, 2], 'C': [3., 4., 5.]})
key, value = 'A', np.array([1., np.nan, -1., 0.])
Expand Down