0

Estou fazendo o pré-processamento dos meus dados utilizando a biblioteca pandas do Python.

Isto é um projeto para treinar um algorítimo a prever "roles"

Este é o resultado que eu tenho quando executo.

print(vagas.role_name.value_counts())
Security Entry                                                     9300
Retail Entry                                                       6562
Healthcare                                                         5884
Food & Hospitality                                                 2559
Unmatched Role                                                     1922
Security Experienced                                               1481
Education                                                           541
Corporate Experienced                                               538
Retail Experienced                                                  309
Service Technician                                                  188
Transportation                                                      183
Sales                                                               175
Software & Technology                                               148
General Labor                                                       128
Corporate Entry                                                     110
Tire Sales & Service                                                 44
Insurance Sales Agent REFERRAL ONLY                                  33
Test and Referrals ONLY                                              29
Customer Service                                                     28
Insurance Sales Agent In Person                                      18
Insurance Sales Agent REFERRAL ONLY - Reliable Life Insurance        17
Security Officer                                                     12
Security Guard (Road Guard)                                           9
Insurance Sales Agent In Person - Reliable Life Insurance             8
Insurance Sales Agent Phone Interview - Reliable Life Insurance       5
Insurance Sales Agent In Person - Union National Life Insurance       4
Insurance Sales Agent Phone Interview                                 3
Guest Service Call Center Representative - example role only          3
Manager in Training - example role only                               3
Visual Merchandiser at Forever 21                                     2
Sales Associate at Forever 21 LIVE                                    2
DO NOT USE                                                            2
Truck Driver - CDL                                                    1
TRAINING ROLE ONLY                                                    1
Experienced Material Handler MCkesson  (4+years)                      1
Tire service Technician                                               1
Assistant Visual Manager at Forever 21                                1
test role MH                                                          1
Sales & Administration                                                1
Lead of Service - Fashion  LIVE                                       1
Delivery Professional                                                 1
Security Officer - Armed                                              1
Co Manager at Forever 21                                              1
Name: role_name, dtype: int64

Quero remover todas as "roles" que tenham menos de 100 linhas

1
  • Ve se minha resposta resolve o teu problema.
    – Terry
    Commented 29/06/2019 às 14:28

1 Resposta 1

0

Pode fazer isso usando groupby com count

df = df.loc[df.groupby('role_name')['role_name'].transform('count') >= 100]

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .