@@ -1723,6 +1723,7 @@ def _get_data(
17231723 picks = None ,
17241724 item = None ,
17251725 * ,
1726+ exclude = (),
17261727 units = None ,
17271728 tmin = None ,
17281729 tmax = None ,
@@ -1740,6 +1741,14 @@ def _get_data(
17401741 %(picks_all)s
17411742 item : slice | array-like | str | list | None
17421743 See docstring of get_data method.
1744+ exclude : list[str] | Literal["bads"]
1745+ Channels to exclude. If ``'bads'``, channels in ``info['bads']`` are
1746+ excluded; pass an empty list or tuple (the default) to include all
1747+ channels. Note: ``exclude`` is currently only applied when ``picks``
1748+ is ``None``; it is ignored when ``picks!=None`` (to be fixed in a
1749+ future release).
1750+
1751+ .. versionadded:: 1.13
17431752 %(units)s
17441753 tmin : int | float | None
17451754 Start time of data to get in seconds.
@@ -1806,7 +1815,7 @@ def _get_data(
18061815
18071816 orig_picks = picks
18081817 if orig_picks is None :
1809- picks = _picks_to_idx (self .info , picks , "all" , exclude = () )
1818+ picks = _picks_to_idx (self .info , picks , "all" , exclude = exclude )
18101819 else :
18111820 picks = _picks_to_idx (self .info , picks )
18121821
@@ -1992,6 +2001,7 @@ def get_data(
19922001 tmin : int | float | None = None ,
19932002 tmax : int | float | None = None ,
19942003 * ,
2004+ exclude : list [str ] | Literal ["bads" ] | tuple = (),
19952005 copy : bool = True ,
19962006 verbose : bool | str | int | None = None ,
19972007 ) -> np .ndarray :
@@ -2019,6 +2029,14 @@ def get_data(
20192029 End time of data to get in seconds.
20202030
20212031 .. versionadded:: 0.24.0
2032+ exclude : list[str] | Literal["bads"]
2033+ Channels to exclude. If ``'bads'``, channels in ``info['bads']`` are
2034+ excluded; pass an empty list or tuple (the default) to include all
2035+ channels. Note: ``exclude`` is currently only applied when ``picks``
2036+ is ``None``; it is ignored when ``picks!=None`` (to be fixed in a
2037+ future release).
2038+
2039+ .. versionadded:: 1.13
20222040 copy : bool
20232041 Whether to return a copy of the object's data, or (if possible) a view.
20242042 See :ref:`the NumPy docs <numpy:basics.copies-and-views>` for an
@@ -2044,7 +2062,13 @@ def get_data(
20442062 when possible when ``copy=False``.
20452063 """
20462064 return self ._get_data (
2047- picks = picks , item = item , units = units , tmin = tmin , tmax = tmax , copy = copy
2065+ picks = picks ,
2066+ exclude = exclude ,
2067+ item = item ,
2068+ units = units ,
2069+ tmin = tmin ,
2070+ tmax = tmax ,
2071+ copy = copy ,
20482072 )
20492073
20502074 @verbose
0 commit comments