Oct-06-2021, 03:17 PM
(Oct-06-2021, 11:55 AM)drunkenneo Wrote: Is there any way to do it in python, kindly help.Yes,next time post some working code and what you tried.
Then it show that you put some effort into it,and it easier to get help.
import pandas as pd from io import StringIO data = StringIO("""\ A B C 1 2 3 4 2 3 D F C 4 5 7""") df = pd.read_csv(data, sep=" ")
>>> df A B C 0 1 2 3 1 4 2 3 2 D F C 3 4 5 7 >>> >>> df_1 = df.iloc[:2,:] >>> df_2 = df.iloc[2:,:] >>> >>> df_1 A B C 0 1 2 3 1 4 2 3 >>> >>> df_2.columns = df_2.iloc[0] >>> df_2 = df_2[1:] >>> df_2 2 D F C 3 4 5 7