Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas
- data = pandas.read_csv('support_data.csv')
- segment = list(data['segment'])
- robocats = list(data['robocats']) # преобразуйте столбец 'robocats' в список
- already_rc_segment_0 = 0 #обнуляем сперва все значения для счетчиков
- already_rc_segment_1 = 0
- already_rc_segment_2 = 0
- for value in robocats:
- if 'Segment 0' in segment:
- already_rc_segment_0 += 1 #посчитаем кол-во робокотов в кажом сегменте
- if 'Segment 1' in segment:
- already_rc_segment_1 += 1
- if 'Segment 2' in segment:
- already_rc_segment_2 += 1
- print(already_rc_segment_0, already_rc_segment_1, already_rc_segment_2, sep='\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement