I have data that I collected in python, exported to csv and I am now using it in Stata. One of my rows represents week_year but since this was created in Python, it shows up as 00-2022, etc. I am not sure how to convert it to stata format (2022w1).
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str4 id float degree_centrality str7 node_week_year1 "505" .02919708 "00-2022" "978" .02919708 "00-2022" "394" .05109489 "00-2022" "630" .02919708 "00-2022" "93" .08029197 "00-2022" "84" .02919708 "00-2022" "20" .23357664 "00-2022" "277" .02919708 "00-2022" "2400" .02919708 "00-2022" "1559" .02919708 "00-2022" "166" .02919708 "00-2022" "982" .02919708 "00-2022" "1806" .05839416 "00-2022" "519" .04379562 "00-2022" "561" .08759124 "00-2022" "521" .02919708 "00-2022" "22" .05839416 "00-2022" "1048" .05109489 "00-2022" "75" .0729927 "00-2022" "80" .02919708 "00-2022" "194" .13868614 "00-2022" "250" .08029197 "00-2022" "174" .13138686 "00-2022" "123" .04379562 "00-2022" "53" .05839416 "00-2022" "39" .15328467 "00-2022" "55" .10948905 "00-2022" "746" .02919708 "00-2022" "199" .05109489 "00-2022" "180" .02919708 "00-2022" "288" .02919708 "00-2022" "13" .05839416 "00-2022" "95" .05109489 "00-2022" "878" .02919708 "00-2022" "204" .05109489 "00-2022" "27" .02919708 "00-2022" "57" .13868614 "00-2022" "284" .05839416 "00-2022" "171" .10218978 "00-2022" "47" .0729927 "00-2022" "107" .03649635 "00-2022" "688" .05109489 "00-2022" "52" .05109489 "00-2022" "676" .04379562 "00-2022" "475" .02919708 "00-2022" "152" .02919708 "00-2022" "713" .02919708 "00-2022" "32" .08759124 "00-2022" "59" .05839416 "00-2022" "335" .09489051 "00-2022" "3" .1678832 "00-2022" "17" .11678832 "00-2022" "2158" .02919708 "00-2022" "44" .05109489 "00-2022" "1314" .05839416 "00-2022" "1067" .02919708 "00-2022" "215" .02919708 "00-2022" "1002" .02919708 "00-2022" "287" .02919708 "00-2022" "917" .02919708 "00-2022" "50" .02919708 "00-2022" "677" .02919708 "00-2022" "156" .08759124 "00-2022" "547" .02919708 "00-2022" "549" .02919708 "00-2022" "103" .0729927 "00-2022" "203" .02919708 "00-2022" "324" .02919708 "00-2022" "662" .03649635 "00-2022" "623" .02919708 "00-2022" "175" .02919708 "00-2022" "360" .02919708 "00-2022" "271" .02919708 "00-2022" "76" .02919708 "00-2022" "139" .02919708 "00-2022" "26" .04379562 "00-2022" "74" .02919708 "00-2022" "310" .02919708 "00-2022" "412" .02919708 "00-2022" "77" .05109489 "00-2022" "69" .08759124 "00-2022" "9" .09489051 "00-2022" "323" .02919708 "00-2022" "38" .06569343 "00-2022" "182" .02189781 "00-2022" "60" .02189781 "00-2022" "668" .02189781 "00-2022" "24" .03649635 "00-2022" "375" .04379562 "00-2022" "1658" .02919708 "00-2022" "158" .02919708 "00-2022" "197" .04379562 "00-2022" "224" .02919708 "00-2022" "222" .02919708 "00-2022" "683" .02919708 "00-2022" "30" .06569343 "00-2022" "358" .02919708 "00-2022" "291" .02919708 "00-2022" "686" .02919708 "00-2022" "90" .02919708 "00-2022" end
Comment