Skip to content

Commit

Permalink
fix: setting with copy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
hmatalonga committed Aug 23, 2019
1 parent e047859 commit d17e156
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def downcast_df(df):

# transform optimized types
if converted_int is not None:
df[converted_int.columns] = converted_int
df.loc[:, converted_int.columns] = converted_int
if converted_float is not None:
df[converted_float.columns] = converted_float
df.loc[:, converted_float.columns] = converted_float
if converted_obj is not None:
df[converted_obj.columns] = converted_obj
df.loc[:, converted_obj.columns] = converted_obj

return df

Expand Down
2 changes: 1 addition & 1 deletion plugins/clean_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def apply(df):
# explicitly cast battery level to integer
df_level = df.battery_level * 100
converted_level = df_level.astype(np.uint8)
df['battery_level'] = converted_level
df.loc[:, 'battery_level'] = converted_level

# filter out malformed records
df = df[df.battery_level <= 100]
Expand Down

0 comments on commit d17e156

Please sign in to comment.