The following two lines throw a SettingWithCopyWarning warning (I am using pandas 2.2.2) because merged_24 is a view of the original merged DataFrame and not a copy.
/tmp/ipykernel_209/3386606497.py:13: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
merged_24['F5.8divF3.6'] = merged_24.ch3flux / merged_24.ch1flux
The following two lines throw a
SettingWithCopyWarning
warning (I am using pandas 2.2.2) becausemerged_24
is a view of the originalmerged
DataFrame and not a copy.I think this
merged_24
should be a copy: