Create Attribute of Comma Seperated Values [duplicate]










0
















This question already has an answer here:



  • How to use groupby to concatenate strings in python pandas?

    1 answer



  • Pandas groupby: How to get a union of strings

    6 answers



I have a loans dataset and each row represents a loan plan and has a customer ID associated with it.



Loan_ID Customer_ID 
1 A
2 B
3 A
4 C
5 A
6 C


I want to create a seperate table which will be grouped by Customer_ID and will contain an attribute that is a comma seperated list of the Loan_ID.



Customer_ID Loan_ID_List
A 1,3,5
B 2
C 4,6









share|improve this question













marked as duplicate by user3483203 python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 14 '18 at 18:16


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • df.astype(str).groupby('Customer_ID')['Loan_ID'].agg(','.join)

    – user3483203
    Nov 14 '18 at 18:18















0
















This question already has an answer here:



  • How to use groupby to concatenate strings in python pandas?

    1 answer



  • Pandas groupby: How to get a union of strings

    6 answers



I have a loans dataset and each row represents a loan plan and has a customer ID associated with it.



Loan_ID Customer_ID 
1 A
2 B
3 A
4 C
5 A
6 C


I want to create a seperate table which will be grouped by Customer_ID and will contain an attribute that is a comma seperated list of the Loan_ID.



Customer_ID Loan_ID_List
A 1,3,5
B 2
C 4,6









share|improve this question













marked as duplicate by user3483203 python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 14 '18 at 18:16


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • df.astype(str).groupby('Customer_ID')['Loan_ID'].agg(','.join)

    – user3483203
    Nov 14 '18 at 18:18













0












0








0









This question already has an answer here:



  • How to use groupby to concatenate strings in python pandas?

    1 answer



  • Pandas groupby: How to get a union of strings

    6 answers



I have a loans dataset and each row represents a loan plan and has a customer ID associated with it.



Loan_ID Customer_ID 
1 A
2 B
3 A
4 C
5 A
6 C


I want to create a seperate table which will be grouped by Customer_ID and will contain an attribute that is a comma seperated list of the Loan_ID.



Customer_ID Loan_ID_List
A 1,3,5
B 2
C 4,6









share|improve this question















This question already has an answer here:



  • How to use groupby to concatenate strings in python pandas?

    1 answer



  • Pandas groupby: How to get a union of strings

    6 answers



I have a loans dataset and each row represents a loan plan and has a customer ID associated with it.



Loan_ID Customer_ID 
1 A
2 B
3 A
4 C
5 A
6 C


I want to create a seperate table which will be grouped by Customer_ID and will contain an attribute that is a comma seperated list of the Loan_ID.



Customer_ID Loan_ID_List
A 1,3,5
B 2
C 4,6




This question already has an answer here:



  • How to use groupby to concatenate strings in python pandas?

    1 answer



  • Pandas groupby: How to get a union of strings

    6 answers







python pandas






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 18:14









Briain O DonnellBriain O Donnell

1339




1339




marked as duplicate by user3483203 python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 14 '18 at 18:16


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by user3483203 python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 14 '18 at 18:16


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • df.astype(str).groupby('Customer_ID')['Loan_ID'].agg(','.join)

    – user3483203
    Nov 14 '18 at 18:18

















  • df.astype(str).groupby('Customer_ID')['Loan_ID'].agg(','.join)

    – user3483203
    Nov 14 '18 at 18:18
















df.astype(str).groupby('Customer_ID')['Loan_ID'].agg(','.join)

– user3483203
Nov 14 '18 at 18:18





df.astype(str).groupby('Customer_ID')['Loan_ID'].agg(','.join)

– user3483203
Nov 14 '18 at 18:18












0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

這個網誌中的熱門文章

What does pagestruct do in Eviews?

Dutch intervention in Lombok and Karangasem

Channel Islands