0

I am trying to delete duplicates.

my df is as follows after using groupby

Unnamed: 0  BCode   Scrip   Group   Type    Open    High    Low Close   Last    PClose  TradesB TTQB    TTVB    ISIN    Date    TDCLOINDI
315370  315370  543348  AXISHETF    B   Q   81.40   81.40   80.59   80.98   80.98   81.63   35  536 43369   INF846K01Z12    2023-05-11  NaN
315371  315371  543348  AXISHETF    B   Q   80.98   81.09   80.10   80.32   80.32   80.98   32  689 55707   INF846K01Z12    2023-05-12  NaN
318763  318763  543348  AXISHETF    B   Q   80.98   81.09   80.10   80.32   80.32   80.98   32  689 55707   INF846K01Z12    2023-05-12  NaN
322649  3391    543348  AXISHETF    B   Q   80.98   81.09   80.10   80.32   80.32   80.98   32  689 55707   INF846K01Z12    2023-05-12  NaN

I tried to use drop_duplicates. I did basic data preparation like collecting info and converting all the dtype in to same dtypes per column etc.

I used keep and inplace also.

I need to know the method to groupby ISIN and Date and delete duplicates on basis of Date and keep first.

Expected Output

315370 315370 543348 AXISHETF B Q 81.40 81.40 80.59 80.98 80.98 81.63 35 536 43369 INF846K01Z12 2023-05-11 NaN 315371 315371 543348 AXISHETF B Q 80.98 81.09 80.10 80.32 80.32 80.98 32 689 55707 INF846K01Z12 2023-05-12 NaN

0 Answers0