title: How to find shared characteristics in pandas?
body: <p>I have a dataset
  <a href="https://i.stack.imgur.com/MsYLA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MsYLA.png" alt="Customer_data" /></a></p>
  <p>I want to get to know our customers by looking at the typical shared characteristics (e.g. &quot;Married customers in their 40s like wine&quot;). This would correspond to the itemset {Married, 40s, Wine}.</p>
  <p>How can I create a new dataframe called customer_data_onehot such that rows correspond to customers (as in the original data set) and columns correspond to the categories of each of the ten categorical attributes in the data. The new dataframe should only contain boolean values (True/False or 0/1s) such that the value in row    and column    is True (or 1) if and only if the attribute value corresponding to the column    holds for the customer corresponding to row   . Display the dataframe.</p>
  <p>I have this hint &quot;Hint: For example, for the attribute &quot;Education&quot; there are 5 possible categories: 'Graduation', 'PhD', 'Master', 'Basic', '2n Cycle'. Therefore, the new dataframe must contain one column for each of those attribute values.&quot; but I don't understand how can I achieve this.</p>
  <p>Can someone guide me here to achieve the correct solution?</p>
  <p>i have this code which Imports the csv file and selects 90% of data from the original dataset.</p>
  <pre><code>import pandas as pd
  pre_process = pd.read_csv('customer_data.csv')  
  pre_process = pre_process.sample(frac=0.9, random_state=413808).to_csv('customer_data_2.csv', 
  index=False)
  </code></pre>