Since you are not publishing your code, I can only give you an answer about the general way of working.
-> This will return a DataFrame that contains only rows with the first occurrence of duplicate values. For instance. if the value 1000 is in 5 lines, only the first line will be returned, and the rest will be deleted.
-> Using df1.shape [0] will return you the number of duplicate values ββin your df.
3. df, " " CSV , - :
df=pd.DataFrame({"A":[0,1,2,3,0,1,2,5,5]})
print(df)
df1=df.drop_duplicates(subset="A",keep="first")
print(df1)
list=[]
for m in df1["A"]:
mask=(df==m)
list.append(df[mask].dropna())
for dfx in range(len(list)):
name="file{0}".format(dfx)
list[dfx].to_csv(r"YOUR PATH\{0}".format(name))