lundi 25 mars 2019

how to split the .text file using Stratified Sampling or Referral sampling technique

I have .txt file

This .txt file may contain 1000 of records with features ,I want apply the Sampling techniques (Stratified Sampling and Multistage sampling)to read & fetch to 5 employee_ID records write this into (output) another file.

Employee ID First Name  last name   State   Country
123            Arti          G          NY  USA
456            Sona          S          NY  USA
789            Geetha        R          NY  USA
256            Keerthi       T          NY  USA
213            Tam           U          NY  USA
321            Sam           I          NY  USA
354            Beta          E          NY  USA
216            Tag           U          NY  USA
327            Sat           I          NY  USA
358            Beti          E          NY  USA
214            Taa           U          NY  USA
325            Sau           I          NY  USA
357            ketti         E          NY  USA

I have counted the number of records and now i want apply the sampling techniques to fetch only 5 employee_ID records

with open("XXXX.txt", "r") as f: counter = 0 for line in f: #print line counter += 1 if counter == 0: break else: print(counter)

Apply Stratified Sampling and Multistage sampling to fetch 5 empoloyee_IDrecords write this into (output) another file




Aucun commentaire:

Enregistrer un commentaire