I referred multiple site related to below issue and I tried different ways but did not get the answer.
I took sample data and run the groupby with condition, I am getting correct output but when append to dataframe or list I am not getting same output which i see on jupter.
My code:
rd = pd.read_csv('C:/......Desktop\convdata.csv')
for x, y in rd.groupby(["ciq", "Obl"]):
print(y.Date.duplicated())
After run the above code I am getting correct output:
But when I create empty data frame and append the duplicated to it, for that I wrote below code:
df3 = pd.DataFrame()
for x, y in rd.groupby(["ciq", "Obl"]):
value = y.Date.duplicated()
df3 = df3.append(value)
print(df3)
I am getting below output:
However, I want output similar like print(y.Date.duplicate) in df3.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.