1

This is my sample data.

  Uid   category Pur_amt Week_number
  103   fashion       25           3
  104      kids       63           2
  104  fashion        12           3

I want to transpose this table into this format .

 Uid  category  X2 X3
  103  fashion   0 25
  104  fashion   0 12
  104     kids  63  0

In the real dataset, I have around 16000 observations, week number varies between 1 and 52 (I want 52 columns).

Jilber Urbina
  • 58,147
  • 10
  • 114
  • 138

0 Answers0