Return a `pandas.DataFrame`, where each row corresponds to an available
    device configuration, including the `device` (i.e., the name of the
    device).
504054
def get_device_configs():
    '''
    
    '''
    frames = []

    for i in range(2):
        for device in get_video_sources():
            df_device_i = get_configs(device)
            df_device_i.insert(0, 'device', str(device))
            frames.append(df_device_i)

    device_configs = pd.concat(frames).drop_duplicates()
    device_configs['label'] = device_configs.device.map(
        lambda x: x.split('/')[-1].split('-')[1].split('_')[0])
    device_configs['bitrate'] = device_configs.height.map(get_bitrate)
    return device_configs
1038590
def to_df(self)->None:
        ""
        return pd.DataFrame(dict(x=self.x._relative_item_paths(), y=[str(o) for o in self.y]))
1252255
def device_info(self):
        
        info = {
            'serial': self.serial,
            'model': self.model,
            'build_info': self.build_info,
            'user_added_info': self._user_added_device_info
        }
        return info
554545
def to_dataframe(self, columns=None):
    """"""
    if not isinstance(self.measured_value, DimensionedMeasuredValue):
      raise TypeError(
        'Only a dimensioned measurement can be converted to a DataFrame')

    if columns is None:
      columns = [d.name for d in self.dimensions]
      columns += [self.units.name if self.units else 'value']

    dataframe = self.measured_value.to_dataframe(columns)

    return dataframe
558170
def datatable_df(self):
        
        data = self._all_datatable_data()
        adf = pd.DataFrame(data)
        adf.columns = self.dt_all_cols
        return self._finish_df(adf, 'ALL')
1371436
def dataframe(self):
        
        temp_index = self._index
        rows = []
        indices = []
        if not self._season:
            return None
        for season in self._season:
            self._index = self._season.index(season)
            rows.append(self._dataframe_fields())
            indices.append(season)
        self._index = temp_index
        return pd.DataFrame(rows, index=[indices])
1352482
def dict_factory(cursor, row):
    """"""
    d = {}
    for idx, col in enumerate(cursor.description):
        d[col[0]] = row[idx]
    return d
569122
def mode(self, **kwargs):
        
        axis = kwargs.get("axis", 0)

        def mode_builder(df, **kwargs):
            result = df.mode(**kwargs)
            # We return a dataframe with the same shape as the input to ensure
            # that all the partitions will be the same shape
            if not axis and len(df) != len(result):
                # Pad columns
                append_values = pandas.DataFrame(
                    columns=result.columns, index=range(len(result), len(df))
                )
                result = pandas.concat([result, append_values], ignore_index=True)
            elif axis and len(df.columns) != len(result.columns):
                # Pad rows
                append_vals = pandas.DataFrame(
                    columns=range(len(result.columns), len(df.columns)),
                    index=result.index,
                )
                result = pandas.concat([result, append_vals], axis=1)
            return pandas.DataFrame(result)

        func = self._prepare_method(mode_builder, **kwargs)
        new_data = self._map_across_full_axis(axis, func)

        new_index = pandas.RangeIndex(len(self.index)) if not axis else self.index
        new_columns = self.columns if not axis else pandas.RangeIndex(len(self.columns))
        new_dtypes = self._dtype_cache
        if new_dtypes is not None:
            new_dtypes.index = new_columns
        return self.__constructor__(
            new_data, new_index, new_columns, new_dtypes
        ).dropna(axis=axis, how="all")
471335
def dataframe(self):
        
        frames = []
        for game in self.__iter__():
            df = game.dataframe
            if df is not None:
                frames.append(df)
        if frames == []:
            return None
        return pd.concat(frames)
415170
def _device_lookup(self, device_name):
        '''  '''
        device_found = {}
        response = requests.get(self._api_url + 'devices',
                                auth=(self._api_key, ''))
        if response.ok:
            for device in response.json()['devices']:
                if device_name == device['extras']['model']:
                    #TODO Check device['extras']['nickname'] as well
                    device_found = device
        return device_found
1339424
def _dict_factory(cursor, row):
        ''' 
        '''
        d = {}
        for idx, col in enumerate(cursor.description):
            if col[0] == 'rowid':
                d['_id'] = row[idx]
            else:
                d[col[0]] = row[idx]
        return d
187671
def row(self, fields):
        """"""

        d = self.dict

        row = [None] * len(fields)

        for i, f in enumerate(fields):
            if f in d:
                row[i] = d[f]

        return row
627524
def get_index(self, name_subdevice) -> int:
        """"""
        try:
            return self.dict_[name_subdevice]
        except KeyError:
            raise OSError(
                'No data for sequence `%s` and (sub)device `%s` '
                'in NetCDF file `%s` available.'
                % (self.name_sequence,
                   name_subdevice,
                   self.name_ncfile))
376822
def table(self, table):
        
        return DataFrame.from_spark_rdd(self.sql_ctx.table(table),
                                        self.sql_ctx)
222957
def dataframe(self):
        
        if self._points_allowed is None and self._points_scored is None:
            return None
        fields_to_include = {
            'boxscore_index': self.boxscore_index,
            'date': self.date,
            'datetime': self.datetime,
            'game': self.game,
            'location': self.location,
            'losses': self.losses,
            'opponent_abbr': self.opponent_abbr,
            'opponent_name': self.opponent_name,
            'points_allowed': self.points_allowed,
            'points_scored': self.points_scored,
            'result': self.result,
            'streak': self.streak,
            'time': self.time,
            'wins': self.wins
        }
        return pd.DataFrame([fields_to_include], index=[self._boxscore])
781606
def dataframe(self, dtype=False, parse_dates=True,  *args, **kwargs):
        """"""

        import pandas as pd

        rg = self.row_generator

        t = self.resolved_url.get_resource().get_target()

        if t.target_format == 'csv':
            return self.read_csv(dtype, parse_dates, *args, **kwargs)

        # Maybe generator has it's own Dataframe method()
        try:

            return rg.dataframe( *args, **kwargs)
        except AttributeError:
            pass

        # Just normal data, so use the iterator in this object.
        headers = next(islice(self, 0, 1))
        data = islice(self, 1, None)

        df = pd.DataFrame(list(data), columns=headers,  *args, **kwargs)

        self.errors = df.metatab_errors = rg.errors if hasattr(rg, 'errors') and rg.errors else {}

        return df
81260
def index_row(a:Union[Collection,pd.DataFrame,pd.Series], idxs:Collection[int])->Any:
    ""
    if a is None: return a
    if isinstance(a,(pd.DataFrame,pd.Series)):
        res = a.iloc[idxs]
        if isinstance(res,(pd.DataFrame,pd.Series)): return res.copy()
        return res
    return a[idxs]