Jump to content

tricky pivot question


Sundaram Sridharan

Recommended Posts

I have a table like this

 

 

 

STIM

Value

Group

RepID

 

 

DMSO

23

G1

1

 

 

STIM1

55

G1

1

 

 

STIM2

72

G1

1

 

 

DMSO

22

G1

2

 

 

STIM1

53

G1

2

 

 

STIM2

75

G1

2

 

 

DMSO

22

G1

3

 

 

STIM1

53

G1

3

 

 

STIM2

75

G1

3

 

 

DMSO

24

G2

1

 

 

STIM1

26

G2

1

 

 

STIM2

32

G2

1

 

 

DMSO

25

G2

2

 

 

STIM1

27

G2

2

 

 

STIM2

33

G2

2

 

 

DMSO

21

G2

3

 

 

STIM1

33

G2

3

 

 

STIM2

29

G2

3

 

 

 

The number of groups, replicates and stimulations are all variable from file to file. I need to somehow transform this and output a CSV/TXT file that looks like this:

Group,DMSO,NaN,NaN,STIM1,NaN,NaN,STIM2,NaN,NaN

G1,23,22,22,55,53,53,72,75,75

G2,24,25,21,26,27,33,32,33,29

it lays out all stimulations and replicates horizontally for each group. How can i do this with a pivot operation

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...