Load UCSC kgXref table.

        Parameters
        ----------
        filename : str
            path to kgXref file

        Returns
        -------
        df : pandas.DataFrame
            kgXref table if loading was successful, else None
486151
def _load_kgXref(filename):
        
        try:
            df = pd.read_table(
                filename,
                names=[
                    "kgID",
                    "mRNA",
                    "spID",
                    "spDisplayID",
                    "geneSymbol",
                    "refseq",
                    "protAcc",
                    "description",
                    "rfamAcc",
                    "tRnaName",
                ],
                index_col=0,
                dtype=object,
            )
            return df
        except Exception as err:
            print(err)
            return None
664474
def load(self, table: str):
        
        if self._check_db() is False:
            return
        if table not in self.db.tables:
            self.warning("The table " + table + " does not exists")
            return
        try:
            self.start("Loading data from table " + table)
            res = self.db[table].all()
            self.df = pd.DataFrame(list(res))
            self.end("Data loaded from table " + table)
        except Exception as e:
            self.err(e, "Can not load table " + table)
1107787
def load(cls, pkid_or_path=None):
        
        path = pkid_or_path
        if isinstance(path, (int, np.int32, np.int64)):
            raise NotImplementedError('Lookup via CMS not implemented.')
        elif not os.path.isfile(path):
            raise FileNotFoundError('File {} not found.'.format(path))
        kwargs = {}
        fields = defaultdict(dict)
        with pd.HDFStore(path) as store:
            for key in store.keys():
                if 'kwargs' in key:
                    kwargs.update(store.get_storer(key).attrs.metadata)
                elif "FIELD" in key:
                    name, dname = "_".join(key.split("_")[1:]).split("/")
                    dname = dname.replace('values', '')
                    fields[name][dname] = store[key]
                else:
                    name = str(key[1:])
                    kwargs[name] = store[key]
        for name, field_data in fields.items():
            fps = field_data.pop('data')
            kwargs[name] = Field(fps, field_values=[field_data[str(arr)] for arr in
                                                    sorted(map(int, field_data.keys()))])
        return cls(**kwargs)
769390
def LoadFile(f, table_name, conn):
  """"""
  reader = csv.reader(f)
  header = next(reader)

  columns = []
  for n in header:
    n = n.replace(' ', '')
    n = n.replace('-', '_')
    columns.append(n)

  create_columns = []
  column_types = {}
  for n in columns:
    if n in column_types:
      create_columns.append("%s %s" % (n, column_types[n]))
    else:
      create_columns.append("%s INTEGER" % (n))

  c = conn.cursor()
  try:
    c.execute("CREATE TABLE %s (%s)" % (table_name, ",".join(create_columns)))
  except sqlite.OperationalError:
    # Likely table exists
    print("table %s already exists?" % (table_name))
    for create_column in create_columns:
      try:
        c.execute("ALTER TABLE %s ADD COLUMN %s" % (table_name, create_column))
      except sqlite.OperationalError:
        # Likely it already exists
        print("column %s already exists in %s?" % (create_column, table_name))

  placeholders = ",".join(["?"] * len(columns))
  insert_values = "INSERT INTO %s (%s) VALUES (%s)" % (table_name, ",".join(columns), placeholders)

  #c.execute("BEGIN TRANSACTION;")
  for row in reader:
    if row:
      if len(row) < len(columns):
        row.extend([None] * (len(columns) - len(row)))
      c.execute(insert_values, row)
  #c.execute("END TRANSACTION;")
  conn.commit()
601133
def read_rawFilesTable(filename):
    """"""
    exp = pd.read_table(filename)
    expected_columns = {'File', 'Exists', 'Size', 'Data format', 'Parameter group', 'Experiment', 'Fraction'}
    found_columns = set(exp.columns)
    if len(expected_columns - found_columns) > 0:
        message = '\n'.join(['The raw files table has the wrong format!',
            'It should contain columns:',
            ', '.join(sorted(expected_columns)),
            'Found columns:',
            ', '.join(sorted(found_columns))])
        raise ValueError(message)
    exp['Raw file'] = exp['File'].apply(path.basename).apply(path.splitext).str.get(0)
    exp['Experiment'] = exp['Experiment'].astype(str)
    return exp
191680
def loadFromFile(fileName):
        
        assert os.path.exists(fileName), "File " + fileName + " does not exist"
        conf = json.load(open(fileName))
        return ReturnInfo(
            articleInfo=ArticleInfoFlags(**conf.get("articleInfo", {})),
            eventInfo=EventInfoFlags(**conf.get("eventInfo", {})),
            sourceInfo=SourceInfoFlags(**conf.get("sourceInfo", {})),
            categoryInfo=CategoryInfoFlags(**conf.get("categoryInfo", {})),
            conceptInfo=ConceptInfoFlags(**conf.get("conceptInfo", {})),
            locationInfo=LocationInfoFlags(**conf.get("locationInfo", {})),
            storyInfo=StoryInfoFlags(**conf.get("storyInfo", {})),
            conceptClassInfo=ConceptClassInfoFlags(**conf.get("conceptClassInfo", {})),
            conceptFolderInfo=ConceptFolderInfoFlags(**conf.get("conceptFolderInfo", {}))
        )
149089
def _get_dataframe(self):
        
        if self.source_conn is None:  # Use local file
            return ge.read_csv(self.dataset_name, **self.dataset_params)

        if isinstance(self.source_conn, S3Hook):
            hook = ExpectationS3CsvHook(aws_conn_id=self.source_conn_id)

            return hook.get_ge_df(self.dataset_name, self.source_bucket_name, **self.dataset_params)

        if isinstance(self.source_conn, DbApiHook):
            hook = ExpectationMySQLHook(mysql_conn_id=self.source_conn_id)

            return hook.get_ge_df(self.dataset_name, **self.dataset_params)
839139
def load_model(self, fname):
        
        if isinstance(fname, STRING_TYPES):  # assume file name
            if os.path.exists(fname):
                _LIB.XGBoosterLoadModel(self.handle, c_str(fname))
            else:
                raise ValueError("No such file: {0}".format(fname))
        else:
            buf = fname
            length = ctypes.c_ulong(len(buf))
            ptr = (ctypes.c_char * len(buf)).from_buffer(buf)
            _check_call(_LIB.XGBoosterLoadModelFromBuffer(self.handle, ptr, length))
92415
def load(cls, filename):
        
        cls.load_counter_offset = StoreOptions.id_offset()
        val = pickle.load(filename)
        cls.load_counter_offset = None
        return val
876524
def load_data(self, filename, *args, **kwargs):
        
        # load parameterized data
        data = super(ParameterizedXLS, self).load_data(filename)
        # add parameter to data
        parameter_name = self.parameterization['parameter']['name']
        parameter_values = self.parameterization['parameter']['values']
        parameter_units = str(self.parameterization['parameter']['units'])
        data[parameter_name] = parameter_values * UREG(parameter_units)
        # number of sheets
        num_sheets = len(self.parameterization['parameter']['sheets'])
        # parse and concatenate parameterized data
        for key in self.parameterization['data']:
            units = str(self.parameterization['data'][key].get('units')) or ''
            datalist = []
            for n in xrange(num_sheets):
                k = key + '_' + str(n)
                datalist.append(data[k].reshape((1, -1)))
                data.pop(k)  # remove unused data keys
            data[key] = np.concatenate(datalist, axis=0) * UREG(units)
        return data
1110011
def load(cls, filename, gzipped, byteorder='big'):
        
        open_file = gzip.open if gzipped else open
        with open_file(filename, 'rb') as buff:
            return cls.from_buffer(buff, byteorder)
994002
def loadFile(self, fileName):
        
        self.fileName = fileName
        self.qteWeb.load(QtCore.QUrl(fileName))
378510
def load_table(filename):
    
    supported = get_table_formats()

    fmt = os.path.splitext(filename)[-1][1:].lower()  # extension sans '.'

    if fmt in ['csv', 'tab', 'tex'] and fmt in supported:
        log.info("Reading file {0}".format(filename))
        t = ascii.read(filename)
    elif fmt in ['vo', 'vot', 'xml', 'fits', 'hdf5'] and fmt in supported:
        log.info("Reading file {0}".format(filename))
        t = Table.read(filename)
    else:
        log.error("Table format not recognized or supported")
        log.error("{0} [{1}]".format(filename, fmt))
        raise Exception("Table format not recognized or supported")
    return t
576210
def load_csv(self):
        
        if path.exists(self.csv_filepath):
            self.results = self.results.append(
                pandas.read_csv(self.csv_filepath))
253910
def load_hdf(cls, filename, path=''): #perhaps this doesn't need to be written?
        

        new = StarPopulation.load_hdf(filename, path=path)

        #setup lazy loading of starmodel if present
        try:
            with pd.HDFStore(filename) as store:
                if '{}/starmodel'.format(path) in store:
                    new._starmodel = None
                    new._starmodel_file = filename
                    new._starmodel_path = '{}/starmodel'.format(path)
        except:
            pass

        try:
            new._make_kde()
        except NoTrapfitError:
            logging.warning('Trapezoid fit not done.')
        return new
352899
def load(cls, filename, format=None):
        
        if format is None:
            # try to derive protocol from file extension
            format = format_from_extension(filename)
        with file(filename, 'rbU') as fp:
            obj = cls.load_from_file_object(fp, format)
            obj.filename = filename
            return obj
704955
def load_data(self, path, *args, **kwargs):
        """"""
        self.df = self._load(path,*args, **kwargs)
        self.series = self.df.iloc[:,0]
        print ("Success! file length: " +str(self.df.shape[0]))