Load all VBB stop names and IDs into a Pandas dataframe.
968934
def load_data(verbose=False):
    ""

    df = pd.read_csv(STOPS_PATH, usecols=['stop_id', 'stop_name'])
    if verbose:
        print('- Loaded %d entries from "%s".' % (len(df), STOPS_PATH))
    return df
21566
def loadVectors(self, filename, cols = None, everyNrows = 1,
                    delim = ' ', checkEven = 1, patterned = 0):
        
        return self.loadVectorsFromFile(filename, cols, everyNrows,
                                        delim, checkEven, patterned)
72579
def _load_ancillary_variables(self, datasets):
        """"""
        all_av_ids = set()
        for dataset in datasets.values():
            ancillary_variables = dataset.attrs.get('ancillary_variables', [])
            if not isinstance(ancillary_variables, (list, tuple, set)):
                ancillary_variables = ancillary_variables.split(' ')
            av_ids = []
            for key in ancillary_variables:
                try:
                    av_ids.append(self.get_dataset_key(key))
                except KeyError:
                    logger.warning("Can't load ancillary dataset %s", str(key))

            all_av_ids |= set(av_ids)
            dataset.attrs['ancillary_variables'] = av_ids
        loadable_av_ids = [av_id for av_id in all_av_ids if av_id not in datasets]
        if not all_av_ids:
            return
        if loadable_av_ids:
            self.load(loadable_av_ids, previous_datasets=datasets)

        for dataset in datasets.values():
            new_vars = []
            for av_id in dataset.attrs.get('ancillary_variables', []):
                if isinstance(av_id, DatasetID):
                    new_vars.append(datasets[av_id])
                else:
                    new_vars.append(av_id)
            dataset.attrs['ancillary_variables'] = new_vars
1034692
def to_dataframe(self):
        """"""
        def row_from_variant(variant):
            return OrderedDict([
                ("chr", variant.contig),
                ("start", variant.original_start),
                ("ref", variant.original_ref),
                ("alt", variant.original_alt),
                ("gene_name", ";".join(variant.gene_names)),
                ("gene_id", ";".join(variant.gene_ids))
            ])
        rows = [row_from_variant(v) for v in self]
        if len(rows) == 0:
            # TODO: return a DataFrame with the appropriate columns
            return pd.DataFrame()
        return pd.DataFrame.from_records(rows, columns=rows[0].keys())
465789
def _load_dataset(dsid, ds_info, file_handlers, dim='y'):
        """"""
        slice_list = []
        failure = True
        for fh in file_handlers:
            try:
                projectable = fh.get_dataset(dsid, ds_info)
                if projectable is not None:
                    slice_list.append(projectable)
                    failure = False
            except KeyError:
                logger.warning("Failed to load {} from {}".format(dsid, fh),
                               exc_info=True)

        if failure:
            raise KeyError(
                "Could not load {} from any provided files".format(dsid))

        if dim not in slice_list[0].dims:
            return slice_list[0]
        res = xr.concat(slice_list, dim=dim)

        combined_info = file_handlers[0].combine_info(
            [p.attrs for p in slice_list])

        res.attrs = combined_info
        return res
77183
def run_stats_df(self):
        """"""

        run_stats_df = []
        for x in self.run_stats:
            search_results = {**x["search_params"]}
            search_results["score"] = x["score"]
            run_stats_df.append(search_results)
        return pd.DataFrame(run_stats_df)
1067240
def _unpack_dataframes(dfs):
    
    col_groups = defaultdict(list)
    columns = dfs[0].columns
    for col in columns:
        key, *loc = col.split(".")
        loc = tuple(int(i) - 1 for i in loc)
        col_groups[key].append((col, loc))

    chains = len(dfs)
    draws = len(dfs[0])
    sample = {}
    for key, cols_locs in col_groups.items():
        ndim = np.array([loc for _, loc in cols_locs]).max(0) + 1
        sample[key] = np.full((chains, draws, *ndim), np.nan)
        for col, loc in cols_locs:
            for chain_id, df in enumerate(dfs):
                draw = df[col].values
                if loc == ():
                    sample[key][chain_id, :] = draw
                else:
                    axis1_all = range(sample[key].shape[1])
                    slicer = (chain_id, axis1_all, *loc)
                    sample[key][slicer] = draw
    return sample
722288
def load_tbl_from_csv(fname):
	
	import csv

	rows_to_load = []

	with open(fname, 'r', encoding='cp1252', errors='ignore') as csvfile:
		csvreader = csv.reader(csvfile, delimiter = ',' )

		reader = csv.reader(csvfile)

		rows_to_load = list(reader)

	return rows_to_load
199699
def multifile_dataframe(paths=['urbanslang{}of4.csv'.format(i) for i in range(1, 5)], header=0, index_col=None):
    """"""
    df = pd.DataFrame()
    for p in paths:
        df = df.append(read_csv(p, header=header, index_col=index_col), ignore_index=True if not index_col else False)
    if index_col and df.index.name == index_col:
        del df[index_col]
    return df
776154
def structs2pandas(structs):
    """"""
    try:
        import pandas
        records = list(structs2records(structs))
        df = pandas.DataFrame.from_records(records)
        # TODO: do this for string columns, for now just for id
        # How can we check for string columns, this is not nice:
        # df.columns[df.dtypes == object]
        if 'id' in df:
            df["id"] = df["id"].apply(str.rstrip)
        return df
    except ImportError:
        # pandas not found, that's ok        
        return structs
677496
async def load_all_aldb(self, clear=True):
        """"""
        for addr in self.plm.devices:
            await self.load_device_aldb(addr, clear)
247229
def load_OGLE3_catalog():
    
    with bz2.BZ2File(CATALOG_PATH) as bz2fp, warnings.catch_warnings():
        warnings.simplefilter("ignore")
        df = pd.read_table(bz2fp, skiprows=6)
    df.rename(columns={"# ID": "ID"}, inplace=True)
    return df
213855
def _ids_and_column_names(names, force_lower_case=False):
        """"""
        fixed = OrderedDict()
        for name in names:
            identifier = RowWrapper._make_identifier(name)
            if force_lower_case:
                identifier = identifier.lower()
            while identifier in fixed:
                identifier = RowWrapper._increment_numeric_suffix(identifier)
            fixed[identifier] = name
        return fixed
497460
def dataframe(self):
        """"""
        data = self.data
        channel_names = self.get_channel_names()
        return pd.DataFrame(data, columns=channel_names)
407303
def _load_data(batch, targets, major_axis):
    """"""
    if isinstance(batch, list):
        new_batch = []
        for i in range(len(targets)):
            new_batch.append([b.data[i] for b in batch])
        new_targets = [[dst for _, dst in d_target] for d_target in targets]
        _load_general(new_batch, new_targets, major_axis)
    else:
        _load_general(batch.data, targets, major_axis)
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]))
1154967
def load(self, dataset_keys, previous_datasets=None):
        """"""
        all_datasets = previous_datasets or DatasetDict()
        datasets = DatasetDict()

        # Include coordinates in the list of datasets to load
        dsids = [self.get_dataset_key(ds_key) for ds_key in dataset_keys]
        coordinates = self._get_coordinates_for_dataset_keys(dsids)
        all_dsids = list(set().union(*coordinates.values())) + dsids

        for dsid in all_dsids:
            if dsid in all_datasets:
                continue
            coords = [all_datasets.get(cid, None)
                      for cid in coordinates.get(dsid, [])]
            ds = self._load_dataset_with_area(dsid, coords)
            if ds is not None:
                all_datasets[dsid] = ds
                if dsid in dsids:
                    datasets[dsid] = ds
        self._load_ancillary_variables(all_datasets)

        return datasets