Trying to determine quartiles for three columns in my dataset [closed]












-1















I have three columns that i'm trying to determine its quartiles.



quantiles = rfm['a', 'b', 'c'].quantile(q=[0.20, 0.40, 0.60, 0.80])


But i get the error: KeyError: ('a', 'b', 'c')



I would like my output to return :



        a   b       c
0.25 5.0 30.0 1145.0
0.50 6.0 75.0 2257.0
0.75 8.0 183.0 3784.0









share|improve this question













closed as off-topic by Prune, pushkin, blue-phoenox, Gibolt, Tim Swast Nov 28 '18 at 23:33


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Prune, pushkin, blue-phoenox, Gibolt, Tim Swast

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 1





    Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.

    – Prune
    Nov 28 '18 at 17:37
















-1















I have three columns that i'm trying to determine its quartiles.



quantiles = rfm['a', 'b', 'c'].quantile(q=[0.20, 0.40, 0.60, 0.80])


But i get the error: KeyError: ('a', 'b', 'c')



I would like my output to return :



        a   b       c
0.25 5.0 30.0 1145.0
0.50 6.0 75.0 2257.0
0.75 8.0 183.0 3784.0









share|improve this question













closed as off-topic by Prune, pushkin, blue-phoenox, Gibolt, Tim Swast Nov 28 '18 at 23:33


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Prune, pushkin, blue-phoenox, Gibolt, Tim Swast

If this question can be reworded to fit the rules in the help center, please edit the question.












  • 1





    Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.

    – Prune
    Nov 28 '18 at 17:37














-1












-1








-1








I have three columns that i'm trying to determine its quartiles.



quantiles = rfm['a', 'b', 'c'].quantile(q=[0.20, 0.40, 0.60, 0.80])


But i get the error: KeyError: ('a', 'b', 'c')



I would like my output to return :



        a   b       c
0.25 5.0 30.0 1145.0
0.50 6.0 75.0 2257.0
0.75 8.0 183.0 3784.0









share|improve this question














I have three columns that i'm trying to determine its quartiles.



quantiles = rfm['a', 'b', 'c'].quantile(q=[0.20, 0.40, 0.60, 0.80])


But i get the error: KeyError: ('a', 'b', 'c')



I would like my output to return :



        a   b       c
0.25 5.0 30.0 1145.0
0.50 6.0 75.0 2257.0
0.75 8.0 183.0 3784.0






python






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 28 '18 at 17:03









Roger SteinbergRoger Steinberg

426116




426116




closed as off-topic by Prune, pushkin, blue-phoenox, Gibolt, Tim Swast Nov 28 '18 at 23:33


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Prune, pushkin, blue-phoenox, Gibolt, Tim Swast

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Prune, pushkin, blue-phoenox, Gibolt, Tim Swast Nov 28 '18 at 23:33


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Prune, pushkin, blue-phoenox, Gibolt, Tim Swast

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1





    Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.

    – Prune
    Nov 28 '18 at 17:37














  • 1





    Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.

    – Prune
    Nov 28 '18 at 17:37








1




1





Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.

– Prune
Nov 28 '18 at 17:37





Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.

– Prune
Nov 28 '18 at 17:37












1 Answer
1






active

oldest

votes


















1














You have it almost right, but you have to pass in the list of columns inside a list object, e.g., with another set of brackets



quantiles = rfm[['a', 'b', 'c']].quantile(q=[0.20, 0.40, 0.60, 0.80])





share|improve this answer



















  • 1





    I wouldn't worry about a downvote or two. I'm glad I could help you.

    – G. Anderson
    Nov 28 '18 at 18:10


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You have it almost right, but you have to pass in the list of columns inside a list object, e.g., with another set of brackets



quantiles = rfm[['a', 'b', 'c']].quantile(q=[0.20, 0.40, 0.60, 0.80])





share|improve this answer



















  • 1





    I wouldn't worry about a downvote or two. I'm glad I could help you.

    – G. Anderson
    Nov 28 '18 at 18:10
















1














You have it almost right, but you have to pass in the list of columns inside a list object, e.g., with another set of brackets



quantiles = rfm[['a', 'b', 'c']].quantile(q=[0.20, 0.40, 0.60, 0.80])





share|improve this answer



















  • 1





    I wouldn't worry about a downvote or two. I'm glad I could help you.

    – G. Anderson
    Nov 28 '18 at 18:10














1












1








1







You have it almost right, but you have to pass in the list of columns inside a list object, e.g., with another set of brackets



quantiles = rfm[['a', 'b', 'c']].quantile(q=[0.20, 0.40, 0.60, 0.80])





share|improve this answer













You have it almost right, but you have to pass in the list of columns inside a list object, e.g., with another set of brackets



quantiles = rfm[['a', 'b', 'c']].quantile(q=[0.20, 0.40, 0.60, 0.80])






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 28 '18 at 17:46









G. AndersonG. Anderson

1,8641411




1,8641411








  • 1





    I wouldn't worry about a downvote or two. I'm glad I could help you.

    – G. Anderson
    Nov 28 '18 at 18:10














  • 1





    I wouldn't worry about a downvote or two. I'm glad I could help you.

    – G. Anderson
    Nov 28 '18 at 18:10








1




1





I wouldn't worry about a downvote or two. I'm glad I could help you.

– G. Anderson
Nov 28 '18 at 18:10





I wouldn't worry about a downvote or two. I'm glad I could help you.

– G. Anderson
Nov 28 '18 at 18:10





Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)