def import_fjc_judges(self, infile=None): if infile is None: self.ensure_input_file() infile = self.options["input_file"] textfields = [ "First Name", "Middle Name", "Last Name", "Gender", "Birth City", "Birth State", "Death City", "Death State", ] df = pd.read_csv(infile) df = df.replace(r"^\s+$", np.nan, regex=True) for x in textfields: df[x] = df[x].replace(np.nan, "", regex=True) df["Professional Career"].replace( to_replace=r";\sno", value=r", no", inplace=True, regex=True ) for i, row in df.iterrows(): if i < self.options["offset"]: continue if i >= self.options["limit"] > 0: break make_federal_judge(dict(row), testing=self.debug)
def import_fjc_judges(self): self.ensure_input_file() textfields = ['firstname', 'midname', 'lastname', 'gender', 'Place of Birth (City)', 'Place of Birth (State)', 'Place of Death (City)', 'Place of Death (State)'] df = pd.read_excel(self.options['input_file'], 0) for x in textfields: df[x] = df[x].replace(np.nan, '', regex=True) for i, row in df.iterrows(): make_federal_judge(dict(row), testing=self.debug)
def import_fjc_judges(self): self.ensure_input_file() textfields = [ 'firstname', 'midname', 'lastname', 'gender', 'Place of Birth (City)', 'Place of Birth (State)', 'Place of Death (City)', 'Place of Death (State)' ] df = pd.read_excel(self.options['input_file'], 0) for x in textfields: df[x] = df[x].replace(np.nan, '', regex=True) for i, row in df.iterrows(): make_federal_judge(dict(row), testing=self.debug)
def import_fjc_judges(self,infile=None): if infile is None: self.ensure_input_file() infile = self.options['input_file'] textfields = ['firstname', 'midname', 'lastname', 'gender', 'Place of Birth (City)', 'Place of Birth (State)', 'Place of Death (City)', 'Place of Death (State)'] df = pd.read_excel(infile, 0) for x in textfields: df[x] = df[x].replace(np.nan, '', regex=True) df['Employment text field'].replace(to_replace=r';\sno', value=r', no', inplace = True, regex = True) for i, row in df.iterrows(): make_federal_judge(dict(row), testing=self.debug)
def import_fjc_judges(self, infile=None): if infile is None: self.ensure_input_file() infile = self.options['input_file'] textfields = ['firstname', 'midname', 'lastname', 'gender', 'Place of Birth (City)', 'Place of Birth (State)', 'Place of Death (City)', 'Place of Death (State)'] df = pd.read_excel(infile, 0) for x in textfields: df[x] = df[x].replace(np.nan, '', regex=True) df['Employment text field'].replace(to_replace=r';\sno', value=r', no', inplace=True, regex=True) for i, row in df.iterrows(): make_federal_judge(dict(row), testing=self.debug)
def import_fjc_judges(self, infile=None): if infile is None: self.ensure_input_file() infile = self.options['input_file'] textfields = ['First Name', 'Middle Name', 'Last Name', 'Gender', 'Birth City', 'Birth State', 'Death City', 'Death State'] df = pd.read_csv(infile) df = df.replace(r'^\s+$', np.nan, regex=True) for x in textfields: df[x] = df[x].replace(np.nan, '', regex=True) df['Professional Career'].replace(to_replace=r';\sno', value=r', no', inplace=True, regex=True) for i, row in df.iterrows(): if i < self.options['offset']: continue if i >= self.options['limit'] > 0: break make_federal_judge(dict(row), testing=self.debug)