Note: I saw all related issues to group by output, and I changed my code accordingly but did not get the required output.
I created test data set after group by with one of the column in the data set. Then I tried below to get desired output.
fd = pd.read_csv("C:/......\Test.csv")
coder_gr = fd.groupby(["CIQ"])
print(coder_gr.first())
for x, y in coder_gr:
y.columns = pd.CategoricalIndex(y.columns)
y.columns = y.columns.add_categories(["Duplicate"])
y["Duplicate"] = y.Date.duplicated()
"""also tried with below code:"""
for x, y in coder_gr:
y.assign(Duplicate = y.Date.duplicated().values, index=y.index)
But getting below empty output or error (Setting with Copy Warning):