The dataframe code works, however I'm getting this warning. I assume I need to use loc somewhere to prevent the slice copy and remove the warning, but not sure where.
df['splitter_size'] = df.groupby(['Cable in', 'Fibre in'])['Fibre in'].transform('count')
/usr/local/lib/python3.9/site-packages/pandas/core/indexing.py:1637: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
self._setitem_single_block(indexer, value, name)