1

I have a data frame that looks something like this:

ID   Date  Name    ColA    ColB    ColC    ColD     Column_Interest
 1  09/12   Ann  String  String  String  String            OneThing
 2  09/13  Pete  String  String  String  String            OneThing
 2  09/13  Pete  String  String  String  String        AnotherThing
 3  09/13   Ann  String  String  String  String            OneThing
 3  09/13   Ann  String  String  String  String        AnotherThing
 3  09/13   Ann  String  String  String  String          ThirdThing
 4  09/12  Pete  String  String  String  String            OneThing

What I want to do:

  1. Create Descriptive Statistics by ID. So, for example, I'd like to know all of the 'Column_Interest' choices for 'ID' = 3. I can see that they selected Several Options when I view the data frame, but I cannot figure out how I should group that data for analysis.
  2. See the most frequent combinations. For example, for those ID's that have more than one row what are the most frequent combinations under 'Column_Interest'? I should note that I am not interested in the order of the selection.
REFER
  • 43
  • 7
  • 1
    You should break each of your tasks down into smaller tasks, and research each of those. For example, for #1, you can group a particular set of rows based on one column's value using the method described [here](https://stackoverflow.com/a/17071908/7315159). And then you can perform analysis on those rows as you like. You should also take a look at the [Pandas docs](https://pandas.pydata.org/pandas-docs/stable/), which has tutorials on using dataframes. – Niayesh Isky May 03 '18 at 03:59

0 Answers0