Hi all,
I have read in a csv using “csv.read()” and then using the link below I have transposed the data.
Transpose of Julia DataFrame - Stack Overflow
This is great and transposes the data as expected, however Julia has added a header on top of the header that already existed.
When I return println(names(df)) I get:
[“variable”, “1”, “2”, “3”, “4”]
Whereas I would expect a header of:
[“YEAR”, “CASH”, “COUNTRY”, “REGION”, “INDICATOR”]
Which is now in Row2
However I want to use the actual header names which are now on row 2, is there any way I can remove this sudo-header and use the actual headers?
My next step is to produce a new column which will sum and subtract based on the column headers “CASH”, “COUNTRY”, “REGION”, “INDICATOR”
I can remove the headers using csv.write(headers = false). However, if it were possible to do this without outputting the data then that would be ideal.
Any suggestions would be greatly appreciated!