79416306

Date: 2025-02-05 22:10:08
Score: 0.5
Natty:
Report link

stmt1 is slow because assigning x to product (df["product"] = "x") first forces Pandas to store product as an object dtype column initially.

df.loc[i, columns] = 0 is also slow because Pandas updates rows one by one, triggering copies.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Temunel