Python Forum
group by create pivot table python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
group by create pivot table python
#1
Hello I searched how can i do this but i did not find anything. please Can you help me . I have data set with three columns. i would to create pivot table in python as in below . clusters are created from column B. table below is created in excel. Thank you so much

A B C
0 0,22 0
0 0,87 1
0 0,63 1
1 0,14 0
0 0,97 1
1 0,38 0
0 0,25 1
1 0,25 0
0 0,54 1
1 0,12 1
1 0,85 1
1 0,95 0
1 0,1 1
0 0,9 1
1 0,5 1
0 0,65 1
1 0,78 0
0 0,96 0
1 0,41 0
1 0,52 1
1 0,23 0
0 0,33 1
1 0,41 1
1 0,56 1
1 0,24 1
1 0,98 0



column B AVERAGE C sum from colum C AVERAGE A
(1) 0-0,1 100,00% 6,25% 100,00%
(2) 0-0,2 50,00% 6,25% 100,00%
(3) 0-0,3 40,00% 12,50% 60,00%
(4) 0-0,4 50,00% 12,50% 75,00%
(5) 0-0,5 100,00% 6,25% 100,00%
(6) 1-0,6 100,00% 18,75% 66,67%
(7) 1-0,7 100,00% 12,50% 0,00%
(8) 1-0,8 0,00% 0,00% 100,00%
(9) 1-0,9 100,00% 18,75% 33,33%
(10) 1-0,95 0,00% 0,00% 100,00%
(11) 1-0,96 0,00% 0,00% 0,00%
(12) 1-0,97 100,00% 6,25% 0,00%
(13) 1-0,98 0,00% 0,00% 100,00%
Total 61,54% 100,00% 61,54%
Reply
#2
What have you tried so far?
Please see: No effort questions
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to parse and group hierarchical list items from an unindented string in Python? ann23fr 0 179 Mar-27-2024, 01:16 PM
Last Post: ann23fr
  How to create a table with different sizes of columns in MS word pepe 8 1,555 Dec-08-2023, 07:31 PM
Last Post: Pedroski55
  Trying to get counts/sum/percentages from pandas similar to pivot table cubangt 6 1,389 Oct-06-2023, 04:32 PM
Last Post: cubangt
  Need Help! Pandas EXCEL PIVOT psb3958 1 944 Nov-13-2022, 10:37 PM
Last Post: deanhystad
  Sum the values in a pandas pivot table specific columns klllmmm 1 4,624 Nov-19-2021, 04:43 PM
Last Post: klllmmm
  pandas pivot table: How to find count for each group in Index and Column JaneTan 0 3,300 Oct-23-2021, 04:35 AM
Last Post: JaneTan
  creating simplex tableau pivot program easy or difficult for a beginner in Python? alex_0 2 2,570 Mar-31-2021, 03:39 AM
Last Post: Larz60+
  How to create db table with SQLite and SQLAlchemy?? marcello86 1 2,310 Sep-02-2020, 03:05 PM
Last Post: marcello86
  Create new column in new created table farhana88 1 1,815 Jun-09-2020, 07:20 AM
Last Post: buran
  Mysql CREATE TABLE IF NOT EXISTS dynamic table name nisusavi 0 2,341 Apr-29-2020, 06:45 PM
Last Post: nisusavi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020