1
Name Class Marks1 Marks2
AA    CC    10     
AA    CC           33
AA    CC    21     
AA    CC           24

I want to transform data in the above format into

Name Class Marks1  Marks2
AA   CC    10      33
AA   CC    21      24

How should i achieve the result? PS- This is just an example of the data the data is too big and has many more columns and it can have many such rows. How should i remove the duplicate rows without affecting the data quality.

Saumya Pandey
  • 317
  • 1
  • 10

1 Answers1

0

You could do

In [421]: df.groupby(df.index // 2).first()
Out[421]:
  Name Class  Marks1  Marks2
0   AA    CC    10.0    33.0
1   AA    CC    21.0    24.0
Zero
  • 74,117
  • 18
  • 147
  • 154