Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Take identical fields and concatenate additional field

$
0
0
I have been having an issue that I cannot seem to solve simply. Any help would be much appreciated.
I have a table (over 3000 rows) with a field "Map_ Code" (about 800 unique codes) which has multiple
"DataSources" with each code. I am trying to get a table of unique Map_Codes along with all the
DataSources for that Map_Code and the summed "Frequency". I have played with pivot table, concatenate
rows, update cursors etc.

Here is an example:

OID Frequency Map_Code DataSource
0 81 !@f DSP14
1 20 !@f DSP77
2 9 !@f DSP81
3 102 !@s DSP19
4 20 !@s DSP27

What I would like to have is

OID Frequency Map_Code DataSource
0 110 !@f DSP14;DSP77;DSP81
1 122 !@s DSP19;DSP27

Viewing all articles
Browse latest Browse all 2485

Trending Articles