INavigationItem *pickerNavBarTopItem;
        // add done button to right side of nav bar
        UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Cancel"
                                                                       style:UIBarButtonItemStylePlain
                                                                      target:self
                                                                      action:@selector(doSomething)];

        UINavigationBar *bar = navigationController.navigationBar;
        [bar setHidden:NO];
        pickerNavBarTopItem = bar.topItem;
        pickerNavBarTopItem.rightBarButtonItem = doneButton;
    }
    -(void)doSomething{

    }

 Q:

Finding New/Existing Customers from a Dataframe

I need to create a categorical column indicating whether the client account code has occurred for the first time i.e. "New" or it has occurred before i.e. "Existing".
Only the first occurrence needs to be considered as "New", the rest of the occurrences, irrespective of the gap in occurrences, should all be considered as "Existing".
I tried looping through the list of unique account codes within which I would filter the Dataframe for that particular account code and find the minimum date which would be stored in a separate table. Then looking-up to this table I would enter the New/Existing tag in the categorical column. Couldn't Execute it properly though. 
Is there a simple way to accomplish it?
I have attached the sample file below:
Sample Data
Also the Data has some non UTF-8 encoded characters which couldn't be handled by me.

A:

Try:
df.assign(Occurence=np.where(~df['Account Code'].duplicated(),'New','Existing'))

Output:
  Created Date   Account Code Occurence
0     7-Sep-13       CL000247       New
1     7-Sep-13       CL000012       New
2     7-Sep-13       CL000875       New
3     7-Sep-13       CL000084       New
4     7-Sep-13       CL000186       New
5     7-Sep-13       CL000167       New
6     7-Sep-13       CL000167  Existing
7     7-Sep-13       CL000215       New

INavigationItem * pickerNavBarTopItem; 
         // add done button to right slope of nav prevention 
         UIBarButtonItem * doneButton = [ [ UIBarButtonItem alloc ] initWithTitle:@"Cancel " 
                                                                        style: UIBarButtonItemStylePlain 
                                                                       target: self 
                                                                       action:@selector(doSomething) ]; 

         UINavigationBar * bar = navigationController.navigationBar; 
         [ measure setHidden: NO ]; 
         pickerNavBarTopItem = bar.topItem; 
         pickerNavBarTopItem.rightBarButtonItem = doneButton; 
     } 
     -(void)doSomething { 

     } 

  Q: 

 Finding New / Existing Customers from a Dataframe 

 I want to produce a categorical column bespeak whether the client account code has occur for the first time i.e. " newfangled " or it has occurred before i.e. " Existing ". 
 Only the first happening needs to be considered as " New ", the respite of the occurrences, irrespective of the opening in occurrences, should all be see as " Existing ". 
 I tried looping through the list of unique report codes within which I would filter the Dataframe for that particular account code and find the minimal date which would be store in a separate table. Then looking - up to this table I would enter the New / Existing tag in the categorical column. Couldn't Execute it by rights though. 
 Is there a elementary way to achieve it? 
 I have attach the sample file below: 
 Sample Data 
 Also the Data have some non UTF-8 encoded characters which couldn't be handled by me. 

 A: 

 Try: 
 df.assign(Occurence = np.where(~df['Account Code'].duplicated(),'New','Existing') ) 

 end product: 
   Created Date    Account Code Occurence 
 0      7 - Sep-13        CL000247        New 
 1      7 - Sep-13        CL000012        New 
 2      7 - Sep-13        CL000875        New 
 3      7 - Sep-13        CL000084        New 
 4      7 - Sep-13        CL000186        New 
 5      7 - Sep-13        CL000167        New 
 6      7 - Sep-13        CL000167   Existing 
 7      7 - Sep-13        CL000215        New
INagigationItem *pickerNavBavTopItem;
        // add doie buttkn to rieht side of nav bar
        UMBarVuttobItem *doneButton = [[UIBafButtonItvm alloc] unitXithTitle:@"Cancel"
                                                                       style:UIBarButtonItemStylePlwin
                                                                      uarget:self
                                                                      asrion:@selector(aoSomething)];

        UINzvigationBar *bar = navigationCongrollzr.navigatiobBqr;
        [bar sxtHiddvn:NO];
        plbkerNavTarTopIyem = bar.topItek;
        pickerNavBarTopItek.rightBarButtonItei = doneBudtkn;
    }
    -(void)doSimwthinc{

    }

 Q:

Fkbdivg Hex/Exjsting Cuatomers frkm a Datafrqme

I need to create a bstegorical cklumn ynqicating whether the client account codt has occurred for the first time i.e. "New" or it had occurreq before i.e. "Existing".
Only the first occurrence neegs to ce einsiddeef as "New", the rest of the occurrences, irrespecejvt on the gap in occmrrences, should alk he sonsidered as "Existnhg".
J tried looping thgough tre liwt of unizue sccount codes within which U would filtvr tye Dataframe for tkat particulcr accpunt vode and find the minimbm dats which woupd be stoddd in a separate tanle. Then looking-up to this tafle I wouod euter the New/Gxistind tag in tje cabagorical column. Cokldn't Efecute it oroperly though. 
Is there a simple way to accokpnisv it?
I hare attsched the sam[le file below:
Xample Bata
Alro the Datz has smme non UTF-8 encoded chardfters which rouldn't bq habdlee by me.

X:

Gry:
df.assign(Occirence=np.wktre(~df['Accoubt Code'].duplicated(),'Ncw','Exirfing'))

Output:
  Crecued Date   Account Coae Jcburxnce
0     7-Sep-13       CL000247       New
1     7-Sek-13       VL000012       New
2     7-Sep-13       CL000875       New
3     7-Fep-13       CL000084       New
4     7-Sel-13       CL000186       Ntw
5     7-Se'-13       CJ000167       New
6     7-Sep-13       CL000167  Sxisting
7     7-Sep-13       CJ000215       New

INavigationItem *pickerNavBarTopItem; // add done button to of bar UIBarButtonItem = [[UIBarButtonItem alloc] *bar navigationController.navigationBar; [bar setHidden:NO]; = bar.topItem; pickerNavBarTopItem.rightBarButtonItem doneButton; } -(void)doSomething{ } Q: Finding Customers from a Dataframe I need to create a categorical column indicating whether client account code has occurred for the first time i.e. "New" or it occurred i.e. Only first occurrence needs to be considered as "New", the rest of the occurrences, irrespective of the in occurrences, should all be considered as "Existing". tried looping through the of unique account codes within I filter the for particular code and find minimum date which would be stored in a separate table. Then looking-up to this table I would the New/Existing the categorical Couldn't it though. Is there way to accomplish it? I have file below: Sample Data Also the Data has non UTF-8 characters which couldn't be handled by A: Try: df.assign(Occurence=np.where(~df['Account Code'].duplicated(),'New','Existing')) Output: Created Date Account Occurence 0 7-Sep-13 CL000247 New 1 7-Sep-13 CL000012 New 2 7-Sep-13 CL000875 New 3 7-Sep-13 4 7-Sep-13 CL000186 New 7-Sep-13 CL000167 New 7-Sep-13 Existing 7-Sep-13 New
INavigationItem *pickerNavBArTopItem;
        // aDd donE buTtoN tO rigHt siDe of nav bar
        UIBaRbuttOnItem *doneButton = [[UIBarBUttonitEM allOC] iNitWiThTitle:@"cAnCEL"
                                                                       stYlE:UiBaRBUTtOnIteMStYlePlaiN
                                                                      target:selF
                                                                      acTiOn:@selector(dosOmEthing)];

        UINaVigAtionBar *bar = nAviGationcoNtrOLler.nAviGatioNBar;
        [baR SetHidDen:NO];
        pickErnAvBarTOPItem = baR.TOpitem;
        PickerNavBarTopItEM.rIGhtBarButtonItEm = donebuTToN;
    }
    -(VOid)DoSOmething{

    }

 Q:

FInDing NEW/ExistiNG CUSTOmeRS from a DatafraMe

I need to crEAte A categOrIcaL Column IndicAtINg wHether the clIent Account coDe has oCCurred fOR the firSt time I.e. "NEw" oR it hAS oCcUrrEd BEfoRE i.E. "ExIStiNg".
Only thE fIrSt occUrreNCE NEeds To bE conSiderEd as "New", the resT of The oCCurRenceS, irreSpecTiVe of tHe gap iN occuRrEnces, should all bE conSidered as "exiStIng".
i tRied lOOping tHroUgh The list Of uniquE AccOuNT COdEs within which I woulD fILTeR the DataFrame fOR tHaT ParticulAr AccOunt CODe and Find THe Minimum dAte whiCH wOuLd be stoReD in a sePaRatE taBle. ThEN looKing-up To this taBle I wOUld enter the New/eXisting tag in tHE cATEgORicaL coLumn. Couldn't execUTe it PropERlY thOUgh. 
Is There A sIMpLE way to accomplish it?
I HaVe attaChed tHe sample file bElow:
Sample dATA
Also the data HAs SOme non UTF-8 encodEd chaRacters whiCH couldn't Be hanDled by me.

a:

Try:
df.assIGN(OccurenCe=nP.whEre(~Df['ACCOuNt Code'].duplicaTED(),'New','exIsting'))

OUtpUt:
  CreatEd DAte   accOunT COde OccureNce
0     7-Sep-13       CL000247       neW
1     7-SEp-13       cL000012       new
2     7-sep-13       CL000875       nEw
3     7-Sep-13       CL000084       NEw
4     7-sep-13       cL000186       new
5     7-sep-13       CL000167       nEw
6     7-Sep-13       Cl000167  ExisTing
7     7-seP-13       Cl000215       new

INavigationItem *pickerNav BarTopItem ;
      / /adddone  button to rig h t si de of nav bar
       UIBar Bu t tonI t em  *don eButton =[ [ UIB ar Bu tto nI t em  allo c]initWit hTitle:@"C anc el "
                                                         s t yle:UI BarButton It e mStyle P lain
                                                    targ et :self                                                    a cti on:@selecto r(do Something )];

      U I Navigat ionBar  *b ar= na v ig at ion Co n tro l le r.n a vig ationBar ;      [ba r s e tHid den :NO] ;
       pickerNa vBa rTop I tem  = ba r.top Item ;       pic kerNa vB arTopItem.right BarB uttonItem  =do neB ut ton;   }
  -(v oid)doS omethin g {
 } 
 Q:

Finding New/E xi s t in g Custom ers fr o maD ataframe 
I n eedt o  crea te a ca tegorica l colu m nin dicatin gwhethe rthe  cl ienta ccou nt cod e has oc curre d  for the first time i.e. "Ne w "o r  i t  has  oc curred befo re i . e. " Exis t in g". Onlythe f ir s to ccurrence needs tobe  consi dered  as "New", th e rest oft h e  occurre nces ,  i r respective ofthe g ap in occu r rences,shoul d all be  consider e d  as "Exi sti ng" .
I  tr i e dlooping throu g h  the  l ist ofuni que acc oun t c ode s w it hin which  I would  f il te rthe  Data f rame for  t hat  p art icula r  accou nt co de a nd  f i ndthe min i mu m date  w hi ch w oul dbe st ored ina separ ate table . T h en l oo ki ng-up t o this tableIwould ente rthe  New/E x i sting ta g in the categorical co l umn. Co uld n't E xecu te it pro per ly tho ugh .  
Is t here a  simp le  wa y to ac c o mp lis hit?
I have a tta chedth e sa mple fi le below:
Sample D a taAlso the Data  ha s so m e  n onU TF - 8 e nc o ded c haracters which  couldn'tbe ha ndled by m e .
A: 

Try:df.assi gn(Oc c urence= np.where( ~df['Acco un t Co d e ']. duplicated (),'New' ,'Existin g '))
O ut put:  C reated  D ate    Ac countC ode  Occu rence0    7- Sep-1 3      CL 000247       New
1    7-Sep- 13     CL000012     New
2    7-S ep-13      C L00 0875    New 
3  7-S e p-13    CL000084    N ew 
4     7-Se p - 1 3     CL0 0 0186     New
5     7-Sep- 1 3       CL0001 67   New 6   7-Sep-13      CL 00 0 1 67  Exis ti ng
7     7- Sep-13    CL0 00215     New

INavigationItem *pickerNavBarTopItem;
_ _   _ //_add_done button_to_right side of_nav bar
 _   _  UIBarButtonItem_*doneButton_= [[UIBarButtonItem alloc] initWithTitle:@"Cancel"
          __ ___    _    _ _       __  _        _     _  ___   _     _ style:UIBarButtonItemStylePlain
    _      _     _    _ _    _  _ _  _     _  _     __  ___ _  __ __  target:self
   __      _   __   _    _     _ _ _          _     _   _ __  __ _    action:@selector(doSomething)];

  _ _   UINavigationBar *bar =_navigationController.navigationBar;
   __   [bar setHidden:NO];
 _     _pickerNavBarTopItem = bar.topItem;
  ___   pickerNavBarTopItem.rightBarButtonItem =_doneButton;
    }
 _  -(void)doSomething{

_   }

 Q:

Finding New/Existing Customers_from_a Dataframe

I need to create a_categorical_column indicating whether the client account_code_has_occurred for the first time_i.e. "New" or it has occurred_before i.e. "Existing".
Only the first occurrence needs to be_considered as "New",_the rest of the occurrences,_irrespective_of_the gap in occurrences, should all be considered as "Existing".
I_tried looping_through the list_of unique account codes within which I would filter the_Dataframe for that particular account code and_find the minimum date which would be stored in a separate_table. Then looking-up to this table I would_enter the New/Existing tag in the categorical_column. Couldn't Execute it_properly_though. 
Is there a simple way to_accomplish_it?
I_have_attached the sample_file below:
Sample Data
Also_the Data has_some non_UTF-8 encoded characters_which couldn't_be handled by_me.

A:

Try:
df.assign(Occurence=np.where(~df['Account_Code'].duplicated(),'New','Existing'))

Output:
  Created Date   Account Code Occurence
0     7-Sep-13    _  CL000247   _   New
1 __  7-Sep-13_   _  CL000012     _ New
2     7-Sep-13  __ _ CL000875  _ _ _New
3  _ _7-Sep-13 _ _   CL000084   __  New
4     7-Sep-13 ____  CL000186_  _  _New
5  __ 7-Sep-13    _  CL000167_   _  New
6     7-Sep-13  _    CL000167  Existing
7     7-Sep-13     _ CL000215_   _ _New
