Use df.at for single-cell assignments: This method avoids ambiguity and is efficient for scalar updates.
df.loc is better for bulk operations: Use it when updating multiple cells at once or for filtering.
The issue doesn't occur when the DataFrame is simple (e.g., no join), as the structure is straightforward.