Convert Rows to cloumn

I have a problem in python. The table looks like the following table I have columns values from 1 to 6: the values are random just to show the general idea

time sensor sample value1 value2 value3 value4 value5 value6
22.10 ACCX 6 0.23 0.44 0.53 0.23 0.44 0.53
22.10 ACCY 6 0.87 0.32 0.12 0.87 0.32 0.12
22.10 ACCZ 6 0.44 0.33 0.45 0.63 0.44 0.93
22.12 ACCX 6 0.63 0.44 0.93 0.87 0.32 0.12
22.12 ACCY 6 0.87 0.32 0.12 0.44 0.33 0.45
22.12 ACCZ 6 0.44 0.33 0.45 0.34 0.22 0.78
22.15 ACCX 6 0.23 0.44 0.53 0.64 0.53 0.25
22.15 ACCY 6 0.87 0.32 0.12 0.87 0.32 0.12
22.15 ACCZ 6 0.44 0.33 0.45 0.44 0.33 0.45
22.18 ACCX 6 0.63 0.44 0.93 0.87 0.32 0.12
22.18 ACCY 6 0.87 0.32 0.12 0.44 0.33 0.45
22.18 ACCZ 6 0.44 0.33 0.45 0.87 0.32 0.12

And I need to convert rows that have same the time and sensor to columns. I need all rows with date and sensor to appear like this where the date will be repeated 6 times:

time ACCX ACCY ACCZ
22.10 0.23 0.44 0.23
22.10 0.87 0.32 0.12
22.10 0.44 0.33 0.45
22.10 0.23 0.44 0.23
22.10 0.87 0.32 0.12
22.10 0.44 0.33 0.45
22.12 0.23 0.44 0.53
22.12 0.87 0.32 0.12
22.12 0.44 0.33 0.45
22.12 0.44 0.33 0.45
22.12 0.63 0.44 0.93
22.12 0.87 0.32 0.12
22.15 0.44 0.33 0.45
22.15 0.23 0.44 0.53
22.15 0.87 0.32 0.12
22.15 0.44 0.33 0.45
22.15 0.63 0.44 0.93
22.15 0.87 0.32 0.12
22.18 0.44 0.33 0.45
22.18 0.44 0.33 0.45
22.18 0.63 0.44 0.93
22.18 0.87 0.32 0.12
22.18 0.44 0.33 0.45
22.18 0.44 0.33 0.45

You should specify what makes a row of the result. In your result you have as first row 22.10, 0.03, 0.44, 0.23. There is a row of the input with time = 22.10, sensor=ACCX, and a value (value1) = 0.23.
However, I don’t see a time=22.10, with sensor=ACCY, and some value=0.44. How did that 0.44 appear in the first row of the result?

Hi Frank, thanks for your reply The values in both tables are random, I put them to clarify the general idea which to convert the rows into columns

You are basically transposing subblocks of 3 lines. Start with separate functions to split into subblocks and another to transpose a single subblock.