Skip to content

Commit

Permalink
Merge pull request #796 from lukeshingles/fix_pandas_warning
Browse files Browse the repository at this point in the history
Prevent pandas SettingWithCopyWarning by copying DataFrames when slicing
  • Loading branch information
wkerzendorf committed Oct 6, 2017
2 parents f7c77d1 + 65029ff commit 0a1a812
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tardis/io/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,13 @@ def prepare_atom_data(

self.macro_atom_data = self.macro_atom_data_all.loc[
self.macro_atom_data_all['atomic_number'].isin(self.selected_atomic_numbers)
]
].copy()

self.macro_atom_references = self.macro_atom_references_all[
self.macro_atom_references_all.index.isin(
self.selected_atomic_numbers,
level='atomic_number')
]
].copy()

if line_interaction_type == 'downbranch':
self.macro_atom_data = self.macro_atom_data.loc[
Expand Down

0 comments on commit 0a1a812

Please sign in to comment.