drms.Client.query

method

Client.query(ds, key=None, seg=None, link=None, convert_numeric=True, skip_conversion=None, pkeys=False, rec_index=False, n=None)

Query keywords, segments and/or links of a record set. At least one of the parameters key, seg, link or pkeys needs to be specified.

Parameters:
ds : string

Record set query.

key : string, list of strings or None

List of requested keywords, optional. If set to None (default), no keyword results will be returned, except when pkeys is True.

seg : string, list of strings or None

List of requested segments, optional. If set to None (default), no segment results will be returned.

link : string, list of strings or None

List of requested Links, optional. If set to None (default), no link results will be returned.

convert_numeric : bool

Convert keywords with numeric types from string to numbers. This may result in NaNs for invalid/missing values. Default is True.

skip_conversion : list of strings or None

List of keywords names to be skipped when performing a numeric conversion. Default is None.

pkeys : bool

If True, all primekeys of the series are added to the key parameter.

rec_index : bool

If True, record names are used as index for the resulting DataFrames.

n : int or None

Limits the number of records returned by the query. For positive values, the first n records of the record set are returned, for negative values the last abs(n) records. If set to None (default), no limit is applied.

Returns:
res_key : pandas.DataFrame, optional

Keyword query results. This DataFrame is only returned, if key is not None or pkeys is set to True.

res_seg : pandas.DataFrame, optional

Segment query results. This DataFrame is only returned, if seg is not None.

res_link : pandas.DataFrame, optional

Link query results. This DataFrame is only returned, if link is not None.