teceai

Untitled

Jan 14th, 2021
437
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pandas as pd
  2. from collections import Counter
  3.  
  4. data = pd.read_csv('/datasets/heart_labeled.csv')
  5.  
  6. # < напишите код здесь >
  7. target = []
  8. for i in range(data.shape[0]):
  9.     labels = data.loc[:, ['label_1', 'label_2', 'label_3']]
  10.     true_label = labels.mode(axis=1)
  11.     target.append(true_label)
  12. data['target'] = target
  13.  
  14. print(data.head())
RAW Paste Data