partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | _return_parsed_timezone_results | Return results from array_strptime if a %z or %Z directive was passed.
Parameters
----------
result : ndarray
int64 date representations of the dates
timezones : ndarray
pytz timezone objects
box : boolean
True boxes result as an Index-like, False returns an ndarray
tz :... | pandas/core/tools/datetimes.py | def _return_parsed_timezone_results(result, timezones, box, tz, name):
"""
Return results from array_strptime if a %z or %Z directive was passed.
Parameters
----------
result : ndarray
int64 date representations of the dates
timezones : ndarray
pytz timezone objects
box : bo... | def _return_parsed_timezone_results(result, timezones, box, tz, name):
"""
Return results from array_strptime if a %z or %Z directive was passed.
Parameters
----------
result : ndarray
int64 date representations of the dates
timezones : ndarray
pytz timezone objects
box : bo... | [
"Return",
"results",
"from",
"array_strptime",
"if",
"a",
"%z",
"or",
"%Z",
"directive",
"was",
"passed",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/tools/datetimes.py#L97-L132 | [
"def",
"_return_parsed_timezone_results",
"(",
"result",
",",
"timezones",
",",
"box",
",",
"tz",
",",
"name",
")",
":",
"if",
"tz",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"\"Cannot pass a tz argument when \"",
"\"parsing strings with timezone \"",
"\... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _convert_listlike_datetimes | Helper function for to_datetime. Performs the conversions of 1D listlike
of dates
Parameters
----------
arg : list, tuple, ndarray, Series, Index
date to be parced
box : boolean
True boxes result as an Index-like, False returns an ndarray
name : object
None or string for... | pandas/core/tools/datetimes.py | def _convert_listlike_datetimes(arg, box, format, name=None, tz=None,
unit=None, errors=None,
infer_datetime_format=None, dayfirst=None,
yearfirst=None, exact=None):
"""
Helper function for to_datetime. Performs the ... | def _convert_listlike_datetimes(arg, box, format, name=None, tz=None,
unit=None, errors=None,
infer_datetime_format=None, dayfirst=None,
yearfirst=None, exact=None):
"""
Helper function for to_datetime. Performs the ... | [
"Helper",
"function",
"for",
"to_datetime",
".",
"Performs",
"the",
"conversions",
"of",
"1D",
"listlike",
"of",
"dates"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/tools/datetimes.py#L135-L326 | [
"def",
"_convert_listlike_datetimes",
"(",
"arg",
",",
"box",
",",
"format",
",",
"name",
"=",
"None",
",",
"tz",
"=",
"None",
",",
"unit",
"=",
"None",
",",
"errors",
"=",
"None",
",",
"infer_datetime_format",
"=",
"None",
",",
"dayfirst",
"=",
"None",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _adjust_to_origin | Helper function for to_datetime.
Adjust input argument to the specified origin
Parameters
----------
arg : list, tuple, ndarray, Series, Index
date to be adjusted
origin : 'julian' or Timestamp
origin offset for the arg
unit : string
passed unit from to_datetime, must be... | pandas/core/tools/datetimes.py | def _adjust_to_origin(arg, origin, unit):
"""
Helper function for to_datetime.
Adjust input argument to the specified origin
Parameters
----------
arg : list, tuple, ndarray, Series, Index
date to be adjusted
origin : 'julian' or Timestamp
origin offset for the arg
unit ... | def _adjust_to_origin(arg, origin, unit):
"""
Helper function for to_datetime.
Adjust input argument to the specified origin
Parameters
----------
arg : list, tuple, ndarray, Series, Index
date to be adjusted
origin : 'julian' or Timestamp
origin offset for the arg
unit ... | [
"Helper",
"function",
"for",
"to_datetime",
".",
"Adjust",
"input",
"argument",
"to",
"the",
"specified",
"origin"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/tools/datetimes.py#L329-L399 | [
"def",
"_adjust_to_origin",
"(",
"arg",
",",
"origin",
",",
"unit",
")",
":",
"if",
"origin",
"==",
"'julian'",
":",
"original",
"=",
"arg",
"j0",
"=",
"Timestamp",
"(",
"0",
")",
".",
"to_julian_date",
"(",
")",
"if",
"unit",
"!=",
"'D'",
":",
"rais... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | to_datetime | Convert argument to datetime.
Parameters
----------
arg : integer, float, string, datetime, list, tuple, 1-d array, Series
.. versionadded:: 0.18.1
or DataFrame/dict-like
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
- If 'raise', then invalid parsing will raise... | pandas/core/tools/datetimes.py | def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
utc=None, box=True, format=None, exact=True,
unit=None, infer_datetime_format=False, origin='unix',
cache=False):
"""
Convert argument to datetime.
Parameters
----------
arg : integ... | def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
utc=None, box=True, format=None, exact=True,
unit=None, infer_datetime_format=False, origin='unix',
cache=False):
"""
Convert argument to datetime.
Parameters
----------
arg : integ... | [
"Convert",
"argument",
"to",
"datetime",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/tools/datetimes.py#L403-L622 | [
"def",
"to_datetime",
"(",
"arg",
",",
"errors",
"=",
"'raise'",
",",
"dayfirst",
"=",
"False",
",",
"yearfirst",
"=",
"False",
",",
"utc",
"=",
"None",
",",
"box",
"=",
"True",
",",
"format",
"=",
"None",
",",
"exact",
"=",
"True",
",",
"unit",
"=... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _assemble_from_unit_mappings | assemble the unit specified fields from the arg (DataFrame)
Return a Series for actual parsing
Parameters
----------
arg : DataFrame
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
- If 'raise', then invalid parsing will raise an exception
- If 'coerce', then invalid parsin... | pandas/core/tools/datetimes.py | def _assemble_from_unit_mappings(arg, errors, box, tz):
"""
assemble the unit specified fields from the arg (DataFrame)
Return a Series for actual parsing
Parameters
----------
arg : DataFrame
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
- If 'raise', then invalid parsin... | def _assemble_from_unit_mappings(arg, errors, box, tz):
"""
assemble the unit specified fields from the arg (DataFrame)
Return a Series for actual parsing
Parameters
----------
arg : DataFrame
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
- If 'raise', then invalid parsin... | [
"assemble",
"the",
"unit",
"specified",
"fields",
"from",
"the",
"arg",
"(",
"DataFrame",
")",
"Return",
"a",
"Series",
"for",
"actual",
"parsing"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/tools/datetimes.py#L650-L737 | [
"def",
"_assemble_from_unit_mappings",
"(",
"arg",
",",
"errors",
",",
"box",
",",
"tz",
")",
":",
"from",
"pandas",
"import",
"to_timedelta",
",",
"to_numeric",
",",
"DataFrame",
"arg",
"=",
"DataFrame",
"(",
"arg",
")",
"if",
"not",
"arg",
".",
"columns"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _attempt_YYYYMMDD | try to parse the YYYYMMDD/%Y%m%d format, try to deal with NaT-like,
arg is a passed in as an object dtype, but could really be ints/strings
with nan-like/or floats (e.g. with nan)
Parameters
----------
arg : passed value
errors : 'raise','ignore','coerce' | pandas/core/tools/datetimes.py | def _attempt_YYYYMMDD(arg, errors):
"""
try to parse the YYYYMMDD/%Y%m%d format, try to deal with NaT-like,
arg is a passed in as an object dtype, but could really be ints/strings
with nan-like/or floats (e.g. with nan)
Parameters
----------
arg : passed value
errors : 'raise','ignore',... | def _attempt_YYYYMMDD(arg, errors):
"""
try to parse the YYYYMMDD/%Y%m%d format, try to deal with NaT-like,
arg is a passed in as an object dtype, but could really be ints/strings
with nan-like/or floats (e.g. with nan)
Parameters
----------
arg : passed value
errors : 'raise','ignore',... | [
"try",
"to",
"parse",
"the",
"YYYYMMDD",
"/",
"%Y%m%d",
"format",
"try",
"to",
"deal",
"with",
"NaT",
"-",
"like",
"arg",
"is",
"a",
"passed",
"in",
"as",
"an",
"object",
"dtype",
"but",
"could",
"really",
"be",
"ints",
"/",
"strings",
"with",
"nan",
... | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/tools/datetimes.py#L740-L789 | [
"def",
"_attempt_YYYYMMDD",
"(",
"arg",
",",
"errors",
")",
":",
"def",
"calc",
"(",
"carg",
")",
":",
"# calculate the actual result",
"carg",
"=",
"carg",
".",
"astype",
"(",
"object",
")",
"parsed",
"=",
"parsing",
".",
"try_parse_year_month_day",
"(",
"c... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | to_time | Parse time strings to time objects using fixed strptime formats ("%H:%M",
"%H%M", "%I:%M%p", "%I%M%p", "%H:%M:%S", "%H%M%S", "%I:%M:%S%p",
"%I%M%S%p")
Use infer_time_format if all the strings are in the same format to speed
up conversion.
Parameters
----------
arg : string in time format, ... | pandas/core/tools/datetimes.py | def to_time(arg, format=None, infer_time_format=False, errors='raise'):
"""
Parse time strings to time objects using fixed strptime formats ("%H:%M",
"%H%M", "%I:%M%p", "%I%M%p", "%H:%M:%S", "%H%M%S", "%I:%M:%S%p",
"%I%M%S%p")
Use infer_time_format if all the strings are in the same format to speed... | def to_time(arg, format=None, infer_time_format=False, errors='raise'):
"""
Parse time strings to time objects using fixed strptime formats ("%H:%M",
"%H%M", "%I:%M%p", "%I%M%p", "%H:%M:%S", "%H%M%S", "%I:%M:%S%p",
"%I%M%S%p")
Use infer_time_format if all the strings are in the same format to speed... | [
"Parse",
"time",
"strings",
"to",
"time",
"objects",
"using",
"fixed",
"strptime",
"formats",
"(",
"%H",
":",
"%M",
"%H%M",
"%I",
":",
"%M%p",
"%I%M%p",
"%H",
":",
"%M",
":",
"%S",
"%H%M%S",
"%I",
":",
"%M",
":",
"%S%p",
"%I%M%S%p",
")"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/tools/datetimes.py#L812-L911 | [
"def",
"to_time",
"(",
"arg",
",",
"format",
"=",
"None",
",",
"infer_time_format",
"=",
"False",
",",
"errors",
"=",
"'raise'",
")",
":",
"def",
"_convert_listlike",
"(",
"arg",
",",
"format",
")",
":",
"if",
"isinstance",
"(",
"arg",
",",
"(",
"list"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | deprecate | Return a new function that emits a deprecation warning on use.
To use this method for a deprecated function, another function
`alternative` with the same signature must exist. The deprecated
function will emit a deprecation warning, and in the docstring
it will contain the deprecation directive with th... | pandas/util/_decorators.py | def deprecate(name, alternative, version, alt_name=None,
klass=None, stacklevel=2, msg=None):
"""
Return a new function that emits a deprecation warning on use.
To use this method for a deprecated function, another function
`alternative` with the same signature must exist. The deprecated
... | def deprecate(name, alternative, version, alt_name=None,
klass=None, stacklevel=2, msg=None):
"""
Return a new function that emits a deprecation warning on use.
To use this method for a deprecated function, another function
`alternative` with the same signature must exist. The deprecated
... | [
"Return",
"a",
"new",
"function",
"that",
"emits",
"a",
"deprecation",
"warning",
"on",
"use",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/util/_decorators.py#L9-L74 | [
"def",
"deprecate",
"(",
"name",
",",
"alternative",
",",
"version",
",",
"alt_name",
"=",
"None",
",",
"klass",
"=",
"None",
",",
"stacklevel",
"=",
"2",
",",
"msg",
"=",
"None",
")",
":",
"alt_name",
"=",
"alt_name",
"or",
"alternative",
".",
"__name... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | deprecate_kwarg | Decorator to deprecate a keyword argument of a function.
Parameters
----------
old_arg_name : str
Name of argument in function to deprecate
new_arg_name : str or None
Name of preferred argument in function. Use None to raise warning that
``old_arg_name`` keyword is deprecated.
... | pandas/util/_decorators.py | def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None, stacklevel=2):
"""
Decorator to deprecate a keyword argument of a function.
Parameters
----------
old_arg_name : str
Name of argument in function to deprecate
new_arg_name : str or None
Name of preferred argument in f... | def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None, stacklevel=2):
"""
Decorator to deprecate a keyword argument of a function.
Parameters
----------
old_arg_name : str
Name of argument in function to deprecate
new_arg_name : str or None
Name of preferred argument in f... | [
"Decorator",
"to",
"deprecate",
"a",
"keyword",
"argument",
"of",
"a",
"function",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/util/_decorators.py#L77-L190 | [
"def",
"deprecate_kwarg",
"(",
"old_arg_name",
",",
"new_arg_name",
",",
"mapping",
"=",
"None",
",",
"stacklevel",
"=",
"2",
")",
":",
"if",
"mapping",
"is",
"not",
"None",
"and",
"not",
"hasattr",
"(",
"mapping",
",",
"'get'",
")",
"and",
"not",
"calla... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | make_signature | Returns a tuple containing the paramenter list with defaults
and parameter list.
Examples
--------
>>> def f(a, b, c=2):
>>> return a * b * c
>>> print(make_signature(f))
(['a', 'b', 'c=2'], ['a', 'b', 'c']) | pandas/util/_decorators.py | def make_signature(func):
"""
Returns a tuple containing the paramenter list with defaults
and parameter list.
Examples
--------
>>> def f(a, b, c=2):
>>> return a * b * c
>>> print(make_signature(f))
(['a', 'b', 'c=2'], ['a', 'b', 'c'])
"""
spec = inspect.getfullargspe... | def make_signature(func):
"""
Returns a tuple containing the paramenter list with defaults
and parameter list.
Examples
--------
>>> def f(a, b, c=2):
>>> return a * b * c
>>> print(make_signature(f))
(['a', 'b', 'c=2'], ['a', 'b', 'c'])
"""
spec = inspect.getfullargspe... | [
"Returns",
"a",
"tuple",
"containing",
"the",
"paramenter",
"list",
"with",
"defaults",
"and",
"parameter",
"list",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/util/_decorators.py#L324-L351 | [
"def",
"make_signature",
"(",
"func",
")",
":",
"spec",
"=",
"inspect",
".",
"getfullargspec",
"(",
"func",
")",
"if",
"spec",
".",
"defaults",
"is",
"None",
":",
"n_wo_defaults",
"=",
"len",
"(",
"spec",
".",
"args",
")",
"defaults",
"=",
"(",
"''",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | period_range | Return a fixed frequency PeriodIndex, with day (calendar) as the default
frequency
Parameters
----------
start : string or period-like, default None
Left bound for generating periods
end : string or period-like, default None
Right bound for generating periods
periods : integer, ... | pandas/core/indexes/period.py | def period_range(start=None, end=None, periods=None, freq=None, name=None):
"""
Return a fixed frequency PeriodIndex, with day (calendar) as the default
frequency
Parameters
----------
start : string or period-like, default None
Left bound for generating periods
end : string or peri... | def period_range(start=None, end=None, periods=None, freq=None, name=None):
"""
Return a fixed frequency PeriodIndex, with day (calendar) as the default
frequency
Parameters
----------
start : string or period-like, default None
Left bound for generating periods
end : string or peri... | [
"Return",
"a",
"fixed",
"frequency",
"PeriodIndex",
"with",
"day",
"(",
"calendar",
")",
"as",
"the",
"default",
"frequency"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/period.py#L903-L964 | [
"def",
"period_range",
"(",
"start",
"=",
"None",
",",
"end",
"=",
"None",
",",
"periods",
"=",
"None",
",",
"freq",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"com",
".",
"count_not_none",
"(",
"start",
",",
"end",
",",
"periods",
")",... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex.from_range | Create RangeIndex from a range object. | pandas/core/indexes/range.py | def from_range(cls, data, name=None, dtype=None, **kwargs):
""" Create RangeIndex from a range object. """
if not isinstance(data, range):
raise TypeError(
'{0}(...) must be called with object coercible to a '
'range, {1} was passed'.format(cls.__name__, repr(... | def from_range(cls, data, name=None, dtype=None, **kwargs):
""" Create RangeIndex from a range object. """
if not isinstance(data, range):
raise TypeError(
'{0}(...) must be called with object coercible to a '
'range, {1} was passed'.format(cls.__name__, repr(... | [
"Create",
"RangeIndex",
"from",
"a",
"range",
"object",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L128-L136 | [
"def",
"from_range",
"(",
"cls",
",",
"data",
",",
"name",
"=",
"None",
",",
"dtype",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"range",
")",
":",
"raise",
"TypeError",
"(",
"'{0}(...) must be called w... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex._format_attrs | Return a list of tuples of the (attr, formatted_value) | pandas/core/indexes/range.py | def _format_attrs(self):
"""
Return a list of tuples of the (attr, formatted_value)
"""
attrs = self._get_data_as_items()
if self.name is not None:
attrs.append(('name', ibase.default_pprint(self.name)))
return attrs | def _format_attrs(self):
"""
Return a list of tuples of the (attr, formatted_value)
"""
attrs = self._get_data_as_items()
if self.name is not None:
attrs.append(('name', ibase.default_pprint(self.name)))
return attrs | [
"Return",
"a",
"list",
"of",
"tuples",
"of",
"the",
"(",
"attr",
"formatted_value",
")"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L200-L207 | [
"def",
"_format_attrs",
"(",
"self",
")",
":",
"attrs",
"=",
"self",
".",
"_get_data_as_items",
"(",
")",
"if",
"self",
".",
"name",
"is",
"not",
"None",
":",
"attrs",
".",
"append",
"(",
"(",
"'name'",
",",
"ibase",
".",
"default_pprint",
"(",
"self",... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex.min | The minimum value of the RangeIndex | pandas/core/indexes/range.py | def min(self, axis=None, skipna=True):
"""The minimum value of the RangeIndex"""
nv.validate_minmax_axis(axis)
return self._minmax('min') | def min(self, axis=None, skipna=True):
"""The minimum value of the RangeIndex"""
nv.validate_minmax_axis(axis)
return self._minmax('min') | [
"The",
"minimum",
"value",
"of",
"the",
"RangeIndex"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L325-L328 | [
"def",
"min",
"(",
"self",
",",
"axis",
"=",
"None",
",",
"skipna",
"=",
"True",
")",
":",
"nv",
".",
"validate_minmax_axis",
"(",
"axis",
")",
"return",
"self",
".",
"_minmax",
"(",
"'min'",
")"
] | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex.max | The maximum value of the RangeIndex | pandas/core/indexes/range.py | def max(self, axis=None, skipna=True):
"""The maximum value of the RangeIndex"""
nv.validate_minmax_axis(axis)
return self._minmax('max') | def max(self, axis=None, skipna=True):
"""The maximum value of the RangeIndex"""
nv.validate_minmax_axis(axis)
return self._minmax('max') | [
"The",
"maximum",
"value",
"of",
"the",
"RangeIndex"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L330-L333 | [
"def",
"max",
"(",
"self",
",",
"axis",
"=",
"None",
",",
"skipna",
"=",
"True",
")",
":",
"nv",
".",
"validate_minmax_axis",
"(",
"axis",
")",
"return",
"self",
".",
"_minmax",
"(",
"'max'",
")"
] | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex.argsort | Returns the indices that would sort the index and its
underlying data.
Returns
-------
argsorted : numpy array
See Also
--------
numpy.ndarray.argsort | pandas/core/indexes/range.py | def argsort(self, *args, **kwargs):
"""
Returns the indices that would sort the index and its
underlying data.
Returns
-------
argsorted : numpy array
See Also
--------
numpy.ndarray.argsort
"""
nv.validate_argsort(args, kwargs)
... | def argsort(self, *args, **kwargs):
"""
Returns the indices that would sort the index and its
underlying data.
Returns
-------
argsorted : numpy array
See Also
--------
numpy.ndarray.argsort
"""
nv.validate_argsort(args, kwargs)
... | [
"Returns",
"the",
"indices",
"that",
"would",
"sort",
"the",
"index",
"and",
"its",
"underlying",
"data",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L335-L353 | [
"def",
"argsort",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"nv",
".",
"validate_argsort",
"(",
"args",
",",
"kwargs",
")",
"if",
"self",
".",
"_step",
">",
"0",
":",
"return",
"np",
".",
"arange",
"(",
"len",
"(",
"self",... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex.equals | Determines if two Index objects contain the same elements. | pandas/core/indexes/range.py | def equals(self, other):
"""
Determines if two Index objects contain the same elements.
"""
if isinstance(other, RangeIndex):
ls = len(self)
lo = len(other)
return (ls == lo == 0 or
ls == lo == 1 and
self._start ... | def equals(self, other):
"""
Determines if two Index objects contain the same elements.
"""
if isinstance(other, RangeIndex):
ls = len(self)
lo = len(other)
return (ls == lo == 0 or
ls == lo == 1 and
self._start ... | [
"Determines",
"if",
"two",
"Index",
"objects",
"contain",
"the",
"same",
"elements",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L355-L369 | [
"def",
"equals",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"RangeIndex",
")",
":",
"ls",
"=",
"len",
"(",
"self",
")",
"lo",
"=",
"len",
"(",
"other",
")",
"return",
"(",
"ls",
"==",
"lo",
"==",
"0",
"or",
"ls"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex.intersection | Form the intersection of two Index objects.
Parameters
----------
other : Index or array-like
sort : False or None, default False
Sort the resulting index if possible
.. versionadded:: 0.24.0
.. versionchanged:: 0.24.1
Changed the de... | pandas/core/indexes/range.py | def intersection(self, other, sort=False):
"""
Form the intersection of two Index objects.
Parameters
----------
other : Index or array-like
sort : False or None, default False
Sort the resulting index if possible
.. versionadded:: 0.24.0
... | def intersection(self, other, sort=False):
"""
Form the intersection of two Index objects.
Parameters
----------
other : Index or array-like
sort : False or None, default False
Sort the resulting index if possible
.. versionadded:: 0.24.0
... | [
"Form",
"the",
"intersection",
"of",
"two",
"Index",
"objects",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L371-L437 | [
"def",
"intersection",
"(",
"self",
",",
"other",
",",
"sort",
"=",
"False",
")",
":",
"self",
".",
"_validate_sort_keyword",
"(",
"sort",
")",
"if",
"self",
".",
"equals",
"(",
"other",
")",
":",
"return",
"self",
".",
"_get_reconciled_name_object",
"(",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex._min_fitting_element | Returns the smallest element greater than or equal to the limit | pandas/core/indexes/range.py | def _min_fitting_element(self, lower_limit):
"""Returns the smallest element greater than or equal to the limit"""
no_steps = -(-(lower_limit - self._start) // abs(self._step))
return self._start + abs(self._step) * no_steps | def _min_fitting_element(self, lower_limit):
"""Returns the smallest element greater than or equal to the limit"""
no_steps = -(-(lower_limit - self._start) // abs(self._step))
return self._start + abs(self._step) * no_steps | [
"Returns",
"the",
"smallest",
"element",
"greater",
"than",
"or",
"equal",
"to",
"the",
"limit"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L439-L442 | [
"def",
"_min_fitting_element",
"(",
"self",
",",
"lower_limit",
")",
":",
"no_steps",
"=",
"-",
"(",
"-",
"(",
"lower_limit",
"-",
"self",
".",
"_start",
")",
"//",
"abs",
"(",
"self",
".",
"_step",
")",
")",
"return",
"self",
".",
"_start",
"+",
"ab... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex._max_fitting_element | Returns the largest element smaller than or equal to the limit | pandas/core/indexes/range.py | def _max_fitting_element(self, upper_limit):
"""Returns the largest element smaller than or equal to the limit"""
no_steps = (upper_limit - self._start) // abs(self._step)
return self._start + abs(self._step) * no_steps | def _max_fitting_element(self, upper_limit):
"""Returns the largest element smaller than or equal to the limit"""
no_steps = (upper_limit - self._start) // abs(self._step)
return self._start + abs(self._step) * no_steps | [
"Returns",
"the",
"largest",
"element",
"smaller",
"than",
"or",
"equal",
"to",
"the",
"limit"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L444-L447 | [
"def",
"_max_fitting_element",
"(",
"self",
",",
"upper_limit",
")",
":",
"no_steps",
"=",
"(",
"upper_limit",
"-",
"self",
".",
"_start",
")",
"//",
"abs",
"(",
"self",
".",
"_step",
")",
"return",
"self",
".",
"_start",
"+",
"abs",
"(",
"self",
".",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex._extended_gcd | Extended Euclidean algorithms to solve Bezout's identity:
a*x + b*y = gcd(x, y)
Finds one particular solution for x, y: s, t
Returns: gcd, s, t | pandas/core/indexes/range.py | def _extended_gcd(self, a, b):
"""
Extended Euclidean algorithms to solve Bezout's identity:
a*x + b*y = gcd(x, y)
Finds one particular solution for x, y: s, t
Returns: gcd, s, t
"""
s, old_s = 0, 1
t, old_t = 1, 0
r, old_r = b, a
while ... | def _extended_gcd(self, a, b):
"""
Extended Euclidean algorithms to solve Bezout's identity:
a*x + b*y = gcd(x, y)
Finds one particular solution for x, y: s, t
Returns: gcd, s, t
"""
s, old_s = 0, 1
t, old_t = 1, 0
r, old_r = b, a
while ... | [
"Extended",
"Euclidean",
"algorithms",
"to",
"solve",
"Bezout",
"s",
"identity",
":",
"a",
"*",
"x",
"+",
"b",
"*",
"y",
"=",
"gcd",
"(",
"x",
"y",
")",
"Finds",
"one",
"particular",
"solution",
"for",
"x",
"y",
":",
"s",
"t",
"Returns",
":",
"gcd"... | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L449-L464 | [
"def",
"_extended_gcd",
"(",
"self",
",",
"a",
",",
"b",
")",
":",
"s",
",",
"old_s",
"=",
"0",
",",
"1",
"t",
",",
"old_t",
"=",
"1",
",",
"0",
"r",
",",
"old_r",
"=",
"b",
",",
"a",
"while",
"r",
":",
"quotient",
"=",
"old_r",
"//",
"r",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex.union | Form the union of two Index objects and sorts if possible
Parameters
----------
other : Index or array-like
sort : False or None, default None
Whether to sort resulting index. ``sort=None`` returns a
mononotically increasing ``RangeIndex`` if possible or a sorte... | pandas/core/indexes/range.py | def union(self, other, sort=None):
"""
Form the union of two Index objects and sorts if possible
Parameters
----------
other : Index or array-like
sort : False or None, default None
Whether to sort resulting index. ``sort=None`` returns a
mononot... | def union(self, other, sort=None):
"""
Form the union of two Index objects and sorts if possible
Parameters
----------
other : Index or array-like
sort : False or None, default None
Whether to sort resulting index. ``sort=None`` returns a
mononot... | [
"Form",
"the",
"union",
"of",
"two",
"Index",
"objects",
"and",
"sorts",
"if",
"possible"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L466-L527 | [
"def",
"union",
"(",
"self",
",",
"other",
",",
"sort",
"=",
"None",
")",
":",
"self",
".",
"_assert_can_do_setop",
"(",
"other",
")",
"if",
"len",
"(",
"other",
")",
"==",
"0",
"or",
"self",
".",
"equals",
"(",
"other",
")",
"or",
"len",
"(",
"s... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | RangeIndex._add_numeric_methods_binary | add in numeric methods, specialized to RangeIndex | pandas/core/indexes/range.py | def _add_numeric_methods_binary(cls):
""" add in numeric methods, specialized to RangeIndex """
def _make_evaluate_binop(op, step=False):
"""
Parameters
----------
op : callable that accepts 2 parms
perform the binary op
step :... | def _add_numeric_methods_binary(cls):
""" add in numeric methods, specialized to RangeIndex """
def _make_evaluate_binop(op, step=False):
"""
Parameters
----------
op : callable that accepts 2 parms
perform the binary op
step :... | [
"add",
"in",
"numeric",
"methods",
"specialized",
"to",
"RangeIndex"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/indexes/range.py#L644-L727 | [
"def",
"_add_numeric_methods_binary",
"(",
"cls",
")",
":",
"def",
"_make_evaluate_binop",
"(",
"op",
",",
"step",
"=",
"False",
")",
":",
"\"\"\"\n Parameters\n ----------\n op : callable that accepts 2 parms\n perform the binary op\n ... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | PandasArray.to_numpy | Convert the PandasArray to a :class:`numpy.ndarray`.
By default, this requires no coercion or copying of data.
Parameters
----------
dtype : numpy.dtype
The NumPy dtype to pass to :func:`numpy.asarray`.
copy : bool, default False
Whether to copy the unde... | pandas/core/arrays/numpy_.py | def to_numpy(self, dtype=None, copy=False):
"""
Convert the PandasArray to a :class:`numpy.ndarray`.
By default, this requires no coercion or copying of data.
Parameters
----------
dtype : numpy.dtype
The NumPy dtype to pass to :func:`numpy.asarray`.
... | def to_numpy(self, dtype=None, copy=False):
"""
Convert the PandasArray to a :class:`numpy.ndarray`.
By default, this requires no coercion or copying of data.
Parameters
----------
dtype : numpy.dtype
The NumPy dtype to pass to :func:`numpy.asarray`.
... | [
"Convert",
"the",
"PandasArray",
"to",
"a",
":",
"class",
":",
"numpy",
".",
"ndarray",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/arrays/numpy_.py#L388-L409 | [
"def",
"to_numpy",
"(",
"self",
",",
"dtype",
"=",
"None",
",",
"copy",
"=",
"False",
")",
":",
"result",
"=",
"np",
".",
"asarray",
"(",
"self",
".",
"_ndarray",
",",
"dtype",
"=",
"dtype",
")",
"if",
"copy",
"and",
"result",
"is",
"self",
".",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | adjoin | Glues together two sets of strings using the amount of space requested.
The idea is to prettify.
----------
space : int
number of spaces for padding
lists : str
list of str which being joined
strlen : callable
function used to calculate the length of each str. Needed for uni... | pandas/io/formats/printing.py | def adjoin(space, *lists, **kwargs):
"""
Glues together two sets of strings using the amount of space requested.
The idea is to prettify.
----------
space : int
number of spaces for padding
lists : str
list of str which being joined
strlen : callable
function used to... | def adjoin(space, *lists, **kwargs):
"""
Glues together two sets of strings using the amount of space requested.
The idea is to prettify.
----------
space : int
number of spaces for padding
lists : str
list of str which being joined
strlen : callable
function used to... | [
"Glues",
"together",
"two",
"sets",
"of",
"strings",
"using",
"the",
"amount",
"of",
"space",
"requested",
".",
"The",
"idea",
"is",
"to",
"prettify",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/formats/printing.py#L12-L44 | [
"def",
"adjoin",
"(",
"space",
",",
"*",
"lists",
",",
"*",
"*",
"kwargs",
")",
":",
"strlen",
"=",
"kwargs",
".",
"pop",
"(",
"'strlen'",
",",
"len",
")",
"justfunc",
"=",
"kwargs",
".",
"pop",
"(",
"'justfunc'",
",",
"justify",
")",
"out_lines",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | justify | Perform ljust, center, rjust against string or list-like | pandas/io/formats/printing.py | def justify(texts, max_len, mode='right'):
"""
Perform ljust, center, rjust against string or list-like
"""
if mode == 'left':
return [x.ljust(max_len) for x in texts]
elif mode == 'center':
return [x.center(max_len) for x in texts]
else:
return [x.rjust(max_len) for x in... | def justify(texts, max_len, mode='right'):
"""
Perform ljust, center, rjust against string or list-like
"""
if mode == 'left':
return [x.ljust(max_len) for x in texts]
elif mode == 'center':
return [x.center(max_len) for x in texts]
else:
return [x.rjust(max_len) for x in... | [
"Perform",
"ljust",
"center",
"rjust",
"against",
"string",
"or",
"list",
"-",
"like"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/formats/printing.py#L47-L56 | [
"def",
"justify",
"(",
"texts",
",",
"max_len",
",",
"mode",
"=",
"'right'",
")",
":",
"if",
"mode",
"==",
"'left'",
":",
"return",
"[",
"x",
".",
"ljust",
"(",
"max_len",
")",
"for",
"x",
"in",
"texts",
"]",
"elif",
"mode",
"==",
"'center'",
":",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _pprint_seq | internal. pprinter for iterables. you should probably use pprint_thing()
rather then calling this directly.
bounds length of printed sequence, depending on options | pandas/io/formats/printing.py | def _pprint_seq(seq, _nest_lvl=0, max_seq_items=None, **kwds):
"""
internal. pprinter for iterables. you should probably use pprint_thing()
rather then calling this directly.
bounds length of printed sequence, depending on options
"""
if isinstance(seq, set):
fmt = "{{{body}}}"
else... | def _pprint_seq(seq, _nest_lvl=0, max_seq_items=None, **kwds):
"""
internal. pprinter for iterables. you should probably use pprint_thing()
rather then calling this directly.
bounds length of printed sequence, depending on options
"""
if isinstance(seq, set):
fmt = "{{{body}}}"
else... | [
"internal",
".",
"pprinter",
"for",
"iterables",
".",
"you",
"should",
"probably",
"use",
"pprint_thing",
"()",
"rather",
"then",
"calling",
"this",
"directly",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/formats/printing.py#L92-L121 | [
"def",
"_pprint_seq",
"(",
"seq",
",",
"_nest_lvl",
"=",
"0",
",",
"max_seq_items",
"=",
"None",
",",
"*",
"*",
"kwds",
")",
":",
"if",
"isinstance",
"(",
"seq",
",",
"set",
")",
":",
"fmt",
"=",
"\"{{{body}}}\"",
"else",
":",
"fmt",
"=",
"\"[{body}]... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _pprint_dict | internal. pprinter for iterables. you should probably use pprint_thing()
rather then calling this directly. | pandas/io/formats/printing.py | def _pprint_dict(seq, _nest_lvl=0, max_seq_items=None, **kwds):
"""
internal. pprinter for iterables. you should probably use pprint_thing()
rather then calling this directly.
"""
fmt = "{{{things}}}"
pairs = []
pfmt = "{key}: {val}"
if max_seq_items is False:
nitems = len(seq)... | def _pprint_dict(seq, _nest_lvl=0, max_seq_items=None, **kwds):
"""
internal. pprinter for iterables. you should probably use pprint_thing()
rather then calling this directly.
"""
fmt = "{{{things}}}"
pairs = []
pfmt = "{key}: {val}"
if max_seq_items is False:
nitems = len(seq)... | [
"internal",
".",
"pprinter",
"for",
"iterables",
".",
"you",
"should",
"probably",
"use",
"pprint_thing",
"()",
"rather",
"then",
"calling",
"this",
"directly",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/formats/printing.py#L124-L150 | [
"def",
"_pprint_dict",
"(",
"seq",
",",
"_nest_lvl",
"=",
"0",
",",
"max_seq_items",
"=",
"None",
",",
"*",
"*",
"kwds",
")",
":",
"fmt",
"=",
"\"{{{things}}}\"",
"pairs",
"=",
"[",
"]",
"pfmt",
"=",
"\"{key}: {val}\"",
"if",
"max_seq_items",
"is",
"Fals... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | pprint_thing | This function is the sanctioned way of converting objects
to a unicode representation.
properly handles nested sequences containing unicode strings
(unicode(object) does not)
Parameters
----------
thing : anything to be formatted
_nest_lvl : internal use only. pprint_thing() is mutually-re... | pandas/io/formats/printing.py | def pprint_thing(thing, _nest_lvl=0, escape_chars=None, default_escapes=False,
quote_strings=False, max_seq_items=None):
"""
This function is the sanctioned way of converting objects
to a unicode representation.
properly handles nested sequences containing unicode strings
(unicode(... | def pprint_thing(thing, _nest_lvl=0, escape_chars=None, default_escapes=False,
quote_strings=False, max_seq_items=None):
"""
This function is the sanctioned way of converting objects
to a unicode representation.
properly handles nested sequences containing unicode strings
(unicode(... | [
"This",
"function",
"is",
"the",
"sanctioned",
"way",
"of",
"converting",
"objects",
"to",
"a",
"unicode",
"representation",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/formats/printing.py#L153-L223 | [
"def",
"pprint_thing",
"(",
"thing",
",",
"_nest_lvl",
"=",
"0",
",",
"escape_chars",
"=",
"None",
",",
"default_escapes",
"=",
"False",
",",
"quote_strings",
"=",
"False",
",",
"max_seq_items",
"=",
"None",
")",
":",
"def",
"as_escaped_unicode",
"(",
"thing... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | format_object_summary | Return the formatted obj as a unicode string
Parameters
----------
obj : object
must be iterable and support __getitem__
formatter : callable
string formatter for an element
is_justify : boolean
should justify the display
name : name, optional
defaults to the cla... | pandas/io/formats/printing.py | def format_object_summary(obj, formatter, is_justify=True, name=None,
indent_for_name=True):
"""
Return the formatted obj as a unicode string
Parameters
----------
obj : object
must be iterable and support __getitem__
formatter : callable
string formatt... | def format_object_summary(obj, formatter, is_justify=True, name=None,
indent_for_name=True):
"""
Return the formatted obj as a unicode string
Parameters
----------
obj : object
must be iterable and support __getitem__
formatter : callable
string formatt... | [
"Return",
"the",
"formatted",
"obj",
"as",
"a",
"unicode",
"string"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/formats/printing.py#L267-L402 | [
"def",
"format_object_summary",
"(",
"obj",
",",
"formatter",
",",
"is_justify",
"=",
"True",
",",
"name",
"=",
"None",
",",
"indent_for_name",
"=",
"True",
")",
":",
"from",
"pandas",
".",
"io",
".",
"formats",
".",
"console",
"import",
"get_console_size",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | format_object_attrs | Return a list of tuples of the (attr, formatted_value)
for common attrs, including dtype, name, length
Parameters
----------
obj : object
must be iterable
Returns
-------
list | pandas/io/formats/printing.py | def format_object_attrs(obj):
"""
Return a list of tuples of the (attr, formatted_value)
for common attrs, including dtype, name, length
Parameters
----------
obj : object
must be iterable
Returns
-------
list
"""
attrs = []
if hasattr(obj, 'dtype'):
at... | def format_object_attrs(obj):
"""
Return a list of tuples of the (attr, formatted_value)
for common attrs, including dtype, name, length
Parameters
----------
obj : object
must be iterable
Returns
-------
list
"""
attrs = []
if hasattr(obj, 'dtype'):
at... | [
"Return",
"a",
"list",
"of",
"tuples",
"of",
"the",
"(",
"attr",
"formatted_value",
")",
"for",
"common",
"attrs",
"including",
"dtype",
"name",
"length"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/formats/printing.py#L405-L428 | [
"def",
"format_object_attrs",
"(",
"obj",
")",
":",
"attrs",
"=",
"[",
"]",
"if",
"hasattr",
"(",
"obj",
",",
"'dtype'",
")",
":",
"attrs",
".",
"append",
"(",
"(",
"'dtype'",
",",
"\"'{}'\"",
".",
"format",
"(",
"obj",
".",
"dtype",
")",
")",
")",... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | read_gbq | Load data from Google BigQuery.
This function requires the `pandas-gbq package
<https://pandas-gbq.readthedocs.io>`__.
See the `How to authenticate with Google BigQuery
<https://pandas-gbq.readthedocs.io/en/latest/howto/authentication.html>`__
guide for authentication instructions.
Parameters... | pandas/io/gbq.py | def read_gbq(query, project_id=None, index_col=None, col_order=None,
reauth=False, auth_local_webserver=False, dialect=None,
location=None, configuration=None, credentials=None,
use_bqstorage_api=None, private_key=None, verbose=None):
"""
Load data from Google BigQuery.
... | def read_gbq(query, project_id=None, index_col=None, col_order=None,
reauth=False, auth_local_webserver=False, dialect=None,
location=None, configuration=None, credentials=None,
use_bqstorage_api=None, private_key=None, verbose=None):
"""
Load data from Google BigQuery.
... | [
"Load",
"data",
"from",
"Google",
"BigQuery",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/io/gbq.py#L24-L167 | [
"def",
"read_gbq",
"(",
"query",
",",
"project_id",
"=",
"None",
",",
"index_col",
"=",
"None",
",",
"col_order",
"=",
"None",
",",
"reauth",
"=",
"False",
",",
"auth_local_webserver",
"=",
"False",
",",
"dialect",
"=",
"None",
",",
"location",
"=",
"Non... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | scatter_matrix | Draw a matrix of scatter plots.
Parameters
----------
frame : DataFrame
alpha : float, optional
amount of transparency applied
figsize : (float,float), optional
a tuple (width, height) in inches
ax : Matplotlib axis object, optional
grid : bool, optional
setting this... | pandas/plotting/_misc.py | def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,
diagonal='hist', marker='.', density_kwds=None,
hist_kwds=None, range_padding=0.05, **kwds):
"""
Draw a matrix of scatter plots.
Parameters
----------
frame : DataFrame
alpha : float, o... | def scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False,
diagonal='hist', marker='.', density_kwds=None,
hist_kwds=None, range_padding=0.05, **kwds):
"""
Draw a matrix of scatter plots.
Parameters
----------
frame : DataFrame
alpha : float, o... | [
"Draw",
"a",
"matrix",
"of",
"scatter",
"plots",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_misc.py#L14-L133 | [
"def",
"scatter_matrix",
"(",
"frame",
",",
"alpha",
"=",
"0.5",
",",
"figsize",
"=",
"None",
",",
"ax",
"=",
"None",
",",
"grid",
"=",
"False",
",",
"diagonal",
"=",
"'hist'",
",",
"marker",
"=",
"'.'",
",",
"density_kwds",
"=",
"None",
",",
"hist_k... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | radviz | Plot a multidimensional dataset in 2D.
Each Series in the DataFrame is represented as a evenly distributed
slice on a circle. Each data point is rendered in the circle according to
the value on each Series. Highly correlated `Series` in the `DataFrame`
are placed closer on the unit circle.
RadViz ... | pandas/plotting/_misc.py | def radviz(frame, class_column, ax=None, color=None, colormap=None, **kwds):
"""
Plot a multidimensional dataset in 2D.
Each Series in the DataFrame is represented as a evenly distributed
slice on a circle. Each data point is rendered in the circle according to
the value on each Series. Highly corr... | def radviz(frame, class_column, ax=None, color=None, colormap=None, **kwds):
"""
Plot a multidimensional dataset in 2D.
Each Series in the DataFrame is represented as a evenly distributed
slice on a circle. Each data point is rendered in the circle according to
the value on each Series. Highly corr... | [
"Plot",
"a",
"multidimensional",
"dataset",
"in",
"2D",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_misc.py#L143-L266 | [
"def",
"radviz",
"(",
"frame",
",",
"class_column",
",",
"ax",
"=",
"None",
",",
"color",
"=",
"None",
",",
"colormap",
"=",
"None",
",",
"*",
"*",
"kwds",
")",
":",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"import",
"matplotlib",
".",
"pa... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | andrews_curves | Generate a matplotlib plot of Andrews curves, for visualising clusters of
multivariate data.
Andrews curves have the functional form:
f(t) = x_1/sqrt(2) + x_2 sin(t) + x_3 cos(t) +
x_4 sin(2t) + x_5 cos(2t) + ...
Where x coefficients correspond to the values of each dimension and t is
... | pandas/plotting/_misc.py | def andrews_curves(frame, class_column, ax=None, samples=200, color=None,
colormap=None, **kwds):
"""
Generate a matplotlib plot of Andrews curves, for visualising clusters of
multivariate data.
Andrews curves have the functional form:
f(t) = x_1/sqrt(2) + x_2 sin(t) + x_3 cos(t... | def andrews_curves(frame, class_column, ax=None, samples=200, color=None,
colormap=None, **kwds):
"""
Generate a matplotlib plot of Andrews curves, for visualising clusters of
multivariate data.
Andrews curves have the functional form:
f(t) = x_1/sqrt(2) + x_2 sin(t) + x_3 cos(t... | [
"Generate",
"a",
"matplotlib",
"plot",
"of",
"Andrews",
"curves",
"for",
"visualising",
"clusters",
"of",
"multivariate",
"data",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_misc.py#L270-L356 | [
"def",
"andrews_curves",
"(",
"frame",
",",
"class_column",
",",
"ax",
"=",
"None",
",",
"samples",
"=",
"200",
",",
"color",
"=",
"None",
",",
"colormap",
"=",
"None",
",",
"*",
"*",
"kwds",
")",
":",
"from",
"math",
"import",
"sqrt",
",",
"pi",
"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | bootstrap_plot | Bootstrap plot on mean, median and mid-range statistics.
The bootstrap plot is used to estimate the uncertainty of a statistic
by relaying on random sampling with replacement [1]_. This function will
generate bootstrapping plots for mean, median and mid-range statistics
for the given number of samples ... | pandas/plotting/_misc.py | def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds):
"""
Bootstrap plot on mean, median and mid-range statistics.
The bootstrap plot is used to estimate the uncertainty of a statistic
by relaying on random sampling with replacement [1]_. This function will
generate bootstrapping plot... | def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds):
"""
Bootstrap plot on mean, median and mid-range statistics.
The bootstrap plot is used to estimate the uncertainty of a statistic
by relaying on random sampling with replacement [1]_. This function will
generate bootstrapping plot... | [
"Bootstrap",
"plot",
"on",
"mean",
"median",
"and",
"mid",
"-",
"range",
"statistics",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_misc.py#L359-L447 | [
"def",
"bootstrap_plot",
"(",
"series",
",",
"fig",
"=",
"None",
",",
"size",
"=",
"50",
",",
"samples",
"=",
"500",
",",
"*",
"*",
"kwds",
")",
":",
"import",
"random",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"# random.sample(ndarray, int) fai... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | parallel_coordinates | Parallel coordinates plotting.
Parameters
----------
frame : DataFrame
class_column : str
Column name containing class names
cols : list, optional
A list of column names to use
ax : matplotlib.axis, optional
matplotlib axis object
color : list or tuple, optional
... | pandas/plotting/_misc.py | def parallel_coordinates(frame, class_column, cols=None, ax=None, color=None,
use_columns=False, xticks=None, colormap=None,
axvlines=True, axvlines_kwds=None, sort_labels=False,
**kwds):
"""Parallel coordinates plotting.
Parameters
... | def parallel_coordinates(frame, class_column, cols=None, ax=None, color=None,
use_columns=False, xticks=None, colormap=None,
axvlines=True, axvlines_kwds=None, sort_labels=False,
**kwds):
"""Parallel coordinates plotting.
Parameters
... | [
"Parallel",
"coordinates",
"plotting",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_misc.py#L452-L563 | [
"def",
"parallel_coordinates",
"(",
"frame",
",",
"class_column",
",",
"cols",
"=",
"None",
",",
"ax",
"=",
"None",
",",
"color",
"=",
"None",
",",
"use_columns",
"=",
"False",
",",
"xticks",
"=",
"None",
",",
"colormap",
"=",
"None",
",",
"axvlines",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | lag_plot | Lag plot for time series.
Parameters
----------
series : Time series
lag : lag of the scatter plot, default 1
ax : Matplotlib axis object, optional
kwds : Matplotlib scatter method keyword arguments, optional
Returns
-------
class:`matplotlib.axis.Axes` | pandas/plotting/_misc.py | def lag_plot(series, lag=1, ax=None, **kwds):
"""Lag plot for time series.
Parameters
----------
series : Time series
lag : lag of the scatter plot, default 1
ax : Matplotlib axis object, optional
kwds : Matplotlib scatter method keyword arguments, optional
Returns
-------
clas... | def lag_plot(series, lag=1, ax=None, **kwds):
"""Lag plot for time series.
Parameters
----------
series : Time series
lag : lag of the scatter plot, default 1
ax : Matplotlib axis object, optional
kwds : Matplotlib scatter method keyword arguments, optional
Returns
-------
clas... | [
"Lag",
"plot",
"for",
"time",
"series",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_misc.py#L566-L593 | [
"def",
"lag_plot",
"(",
"series",
",",
"lag",
"=",
"1",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwds",
")",
":",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"# workaround because `c='b'` is hardcoded in matplotlibs scatter method",
"kwds",
".",
"setdefau... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | autocorrelation_plot | Autocorrelation plot for time series.
Parameters:
-----------
series: Time series
ax: Matplotlib axis object, optional
kwds : keywords
Options to pass to matplotlib plotting method
Returns:
-----------
class:`matplotlib.axis.Axes` | pandas/plotting/_misc.py | def autocorrelation_plot(series, ax=None, **kwds):
"""
Autocorrelation plot for time series.
Parameters:
-----------
series: Time series
ax: Matplotlib axis object, optional
kwds : keywords
Options to pass to matplotlib plotting method
Returns:
-----------
class:`matplo... | def autocorrelation_plot(series, ax=None, **kwds):
"""
Autocorrelation plot for time series.
Parameters:
-----------
series: Time series
ax: Matplotlib axis object, optional
kwds : keywords
Options to pass to matplotlib plotting method
Returns:
-----------
class:`matplo... | [
"Autocorrelation",
"plot",
"for",
"time",
"series",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_misc.py#L596-L637 | [
"def",
"autocorrelation_plot",
"(",
"series",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwds",
")",
":",
"import",
"matplotlib",
".",
"pyplot",
"as",
"plt",
"n",
"=",
"len",
"(",
"series",
")",
"data",
"=",
"np",
".",
"asarray",
"(",
"series",
")",
"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _any_pandas_objects | Check a sequence of terms for instances of PandasObject. | pandas/core/computation/align.py | def _any_pandas_objects(terms):
"""Check a sequence of terms for instances of PandasObject."""
return any(isinstance(term.value, pd.core.generic.PandasObject)
for term in terms) | def _any_pandas_objects(terms):
"""Check a sequence of terms for instances of PandasObject."""
return any(isinstance(term.value, pd.core.generic.PandasObject)
for term in terms) | [
"Check",
"a",
"sequence",
"of",
"terms",
"for",
"instances",
"of",
"PandasObject",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/computation/align.py#L36-L39 | [
"def",
"_any_pandas_objects",
"(",
"terms",
")",
":",
"return",
"any",
"(",
"isinstance",
"(",
"term",
".",
"value",
",",
"pd",
".",
"core",
".",
"generic",
".",
"PandasObject",
")",
"for",
"term",
"in",
"terms",
")"
] | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _align | Align a set of terms | pandas/core/computation/align.py | def _align(terms):
"""Align a set of terms"""
try:
# flatten the parse tree (a nested list, really)
terms = list(com.flatten(terms))
except TypeError:
# can't iterate so it must just be a constant or single variable
if isinstance(terms.value, pd.core.generic.NDFrame):
... | def _align(terms):
"""Align a set of terms"""
try:
# flatten the parse tree (a nested list, really)
terms = list(com.flatten(terms))
except TypeError:
# can't iterate so it must just be a constant or single variable
if isinstance(terms.value, pd.core.generic.NDFrame):
... | [
"Align",
"a",
"set",
"of",
"terms"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/computation/align.py#L114-L132 | [
"def",
"_align",
"(",
"terms",
")",
":",
"try",
":",
"# flatten the parse tree (a nested list, really)",
"terms",
"=",
"list",
"(",
"com",
".",
"flatten",
"(",
"terms",
")",
")",
"except",
"TypeError",
":",
"# can't iterate so it must just be a constant or single variab... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _reconstruct_object | Reconstruct an object given its type, raw value, and possibly empty
(None) axes.
Parameters
----------
typ : object
A type
obj : object
The value to use in the type constructor
axes : dict
The axes to use to construct the resulting pandas object
Returns
-------
... | pandas/core/computation/align.py | def _reconstruct_object(typ, obj, axes, dtype):
"""Reconstruct an object given its type, raw value, and possibly empty
(None) axes.
Parameters
----------
typ : object
A type
obj : object
The value to use in the type constructor
axes : dict
The axes to use to construc... | def _reconstruct_object(typ, obj, axes, dtype):
"""Reconstruct an object given its type, raw value, and possibly empty
(None) axes.
Parameters
----------
typ : object
A type
obj : object
The value to use in the type constructor
axes : dict
The axes to use to construc... | [
"Reconstruct",
"an",
"object",
"given",
"its",
"type",
"raw",
"value",
"and",
"possibly",
"empty",
"(",
"None",
")",
"axes",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/computation/align.py#L135-L177 | [
"def",
"_reconstruct_object",
"(",
"typ",
",",
"obj",
",",
"axes",
",",
"dtype",
")",
":",
"try",
":",
"typ",
"=",
"typ",
".",
"type",
"except",
"AttributeError",
":",
"pass",
"res_t",
"=",
"np",
".",
"result_type",
"(",
"obj",
".",
"dtype",
",",
"dt... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | tsplot | Plots a Series on the given Matplotlib axes or the current axes
Parameters
----------
axes : Axes
series : Series
Notes
_____
Supports same kwargs as Axes.plot
.. deprecated:: 0.23.0
Use Series.plot() instead | pandas/plotting/_timeseries.py | def tsplot(series, plotf, ax=None, **kwargs):
import warnings
"""
Plots a Series on the given Matplotlib axes or the current axes
Parameters
----------
axes : Axes
series : Series
Notes
_____
Supports same kwargs as Axes.plot
.. deprecated:: 0.23.0
Use Series.plot(... | def tsplot(series, plotf, ax=None, **kwargs):
import warnings
"""
Plots a Series on the given Matplotlib axes or the current axes
Parameters
----------
axes : Axes
series : Series
Notes
_____
Supports same kwargs as Axes.plot
.. deprecated:: 0.23.0
Use Series.plot(... | [
"Plots",
"a",
"Series",
"on",
"the",
"given",
"Matplotlib",
"axes",
"or",
"the",
"current",
"axes"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_timeseries.py#L26-L62 | [
"def",
"tsplot",
"(",
"series",
",",
"plotf",
",",
"ax",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"import",
"warnings",
"warnings",
".",
"warn",
"(",
"\"'tsplot' is deprecated and will be removed in a \"",
"\"future version. Please use Series.plot() instead.\"",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _decorate_axes | Initialize axes for time-series plotting | pandas/plotting/_timeseries.py | def _decorate_axes(ax, freq, kwargs):
"""Initialize axes for time-series plotting"""
if not hasattr(ax, '_plot_data'):
ax._plot_data = []
ax.freq = freq
xaxis = ax.get_xaxis()
xaxis.freq = freq
if not hasattr(ax, 'legendlabels'):
ax.legendlabels = [kwargs.get('label', None)]
... | def _decorate_axes(ax, freq, kwargs):
"""Initialize axes for time-series plotting"""
if not hasattr(ax, '_plot_data'):
ax._plot_data = []
ax.freq = freq
xaxis = ax.get_xaxis()
xaxis.freq = freq
if not hasattr(ax, 'legendlabels'):
ax.legendlabels = [kwargs.get('label', None)]
... | [
"Initialize",
"axes",
"for",
"time",
"-",
"series",
"plotting"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_timeseries.py#L157-L170 | [
"def",
"_decorate_axes",
"(",
"ax",
",",
"freq",
",",
"kwargs",
")",
":",
"if",
"not",
"hasattr",
"(",
"ax",
",",
"'_plot_data'",
")",
":",
"ax",
".",
"_plot_data",
"=",
"[",
"]",
"ax",
".",
"freq",
"=",
"freq",
"xaxis",
"=",
"ax",
".",
"get_xaxis"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | _get_ax_freq | Get the freq attribute of the ax object if set.
Also checks shared axes (eg when using secondary yaxis, sharex=True
or twinx) | pandas/plotting/_timeseries.py | def _get_ax_freq(ax):
"""
Get the freq attribute of the ax object if set.
Also checks shared axes (eg when using secondary yaxis, sharex=True
or twinx)
"""
ax_freq = getattr(ax, 'freq', None)
if ax_freq is None:
# check for left/right ax in case of secondary yaxis
if hasattr(... | def _get_ax_freq(ax):
"""
Get the freq attribute of the ax object if set.
Also checks shared axes (eg when using secondary yaxis, sharex=True
or twinx)
"""
ax_freq = getattr(ax, 'freq', None)
if ax_freq is None:
# check for left/right ax in case of secondary yaxis
if hasattr(... | [
"Get",
"the",
"freq",
"attribute",
"of",
"the",
"ax",
"object",
"if",
"set",
".",
"Also",
"checks",
"shared",
"axes",
"(",
"eg",
"when",
"using",
"secondary",
"yaxis",
"sharex",
"=",
"True",
"or",
"twinx",
")"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_timeseries.py#L173-L194 | [
"def",
"_get_ax_freq",
"(",
"ax",
")",
":",
"ax_freq",
"=",
"getattr",
"(",
"ax",
",",
"'freq'",
",",
"None",
")",
"if",
"ax_freq",
"is",
"None",
":",
"# check for left/right ax in case of secondary yaxis",
"if",
"hasattr",
"(",
"ax",
",",
"'left_ax'",
")",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | format_timedelta_ticks | Convert seconds to 'D days HH:MM:SS.F' | pandas/plotting/_timeseries.py | def format_timedelta_ticks(x, pos, n_decimals):
"""
Convert seconds to 'D days HH:MM:SS.F'
"""
s, ns = divmod(x, 1e9)
m, s = divmod(s, 60)
h, m = divmod(m, 60)
d, h = divmod(h, 24)
decimals = int(ns * 10**(n_decimals - 9))
s = r'{:02d}:{:02d}:{:02d}'.format(int(h), int(m), int(s))
... | def format_timedelta_ticks(x, pos, n_decimals):
"""
Convert seconds to 'D days HH:MM:SS.F'
"""
s, ns = divmod(x, 1e9)
m, s = divmod(s, 60)
h, m = divmod(m, 60)
d, h = divmod(h, 24)
decimals = int(ns * 10**(n_decimals - 9))
s = r'{:02d}:{:02d}:{:02d}'.format(int(h), int(m), int(s))
... | [
"Convert",
"seconds",
"to",
"D",
"days",
"HH",
":",
"MM",
":",
"SS",
".",
"F"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_timeseries.py#L289-L303 | [
"def",
"format_timedelta_ticks",
"(",
"x",
",",
"pos",
",",
"n_decimals",
")",
":",
"s",
",",
"ns",
"=",
"divmod",
"(",
"x",
",",
"1e9",
")",
"m",
",",
"s",
"=",
"divmod",
"(",
"s",
",",
"60",
")",
"h",
",",
"m",
"=",
"divmod",
"(",
"m",
",",... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | format_dateaxis | Pretty-formats the date axis (x-axis).
Major and minor ticks are automatically set for the frequency of the
current underlying series. As the dynamic mode is activated by
default, changing the limits of the x axis will intelligently change
the positions of the ticks. | pandas/plotting/_timeseries.py | def format_dateaxis(subplot, freq, index):
"""
Pretty-formats the date axis (x-axis).
Major and minor ticks are automatically set for the frequency of the
current underlying series. As the dynamic mode is activated by
default, changing the limits of the x axis will intelligently change
the pos... | def format_dateaxis(subplot, freq, index):
"""
Pretty-formats the date axis (x-axis).
Major and minor ticks are automatically set for the frequency of the
current underlying series. As the dynamic mode is activated by
default, changing the limits of the x axis will intelligently change
the pos... | [
"Pretty",
"-",
"formats",
"the",
"date",
"axis",
"(",
"x",
"-",
"axis",
")",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/plotting/_timeseries.py#L310-L352 | [
"def",
"format_dateaxis",
"(",
"subplot",
",",
"freq",
",",
"index",
")",
":",
"# handle index specific formatting",
"# Note: DatetimeIndex does not use this",
"# interface. DatetimeIndex uses matplotlib.date directly",
"if",
"isinstance",
"(",
"index",
",",
"ABCPeriodIndex",
"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame._is_homogeneous_type | Whether all the columns in a DataFrame have the same type.
Returns
-------
bool
Examples
--------
>>> DataFrame({"A": [1, 2], "B": [3, 4]})._is_homogeneous_type
True
>>> DataFrame({"A": [1, 2], "B": [3.0, 4.0]})._is_homogeneous_type
False
... | pandas/core/frame.py | def _is_homogeneous_type(self):
"""
Whether all the columns in a DataFrame have the same type.
Returns
-------
bool
Examples
--------
>>> DataFrame({"A": [1, 2], "B": [3, 4]})._is_homogeneous_type
True
>>> DataFrame({"A": [1, 2], "B": [3.... | def _is_homogeneous_type(self):
"""
Whether all the columns in a DataFrame have the same type.
Returns
-------
bool
Examples
--------
>>> DataFrame({"A": [1, 2], "B": [3, 4]})._is_homogeneous_type
True
>>> DataFrame({"A": [1, 2], "B": [3.... | [
"Whether",
"all",
"the",
"columns",
"in",
"a",
"DataFrame",
"have",
"the",
"same",
"type",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L514-L540 | [
"def",
"_is_homogeneous_type",
"(",
"self",
")",
":",
"if",
"self",
".",
"_data",
".",
"any_extension_types",
":",
"return",
"len",
"(",
"{",
"block",
".",
"dtype",
"for",
"block",
"in",
"self",
".",
"_data",
".",
"blocks",
"}",
")",
"==",
"1",
"else",... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame._repr_html_ | Return a html representation for a particular DataFrame.
Mainly for IPython notebook. | pandas/core/frame.py | def _repr_html_(self):
"""
Return a html representation for a particular DataFrame.
Mainly for IPython notebook.
"""
if self._info_repr():
buf = StringIO("")
self.info(buf=buf)
# need to escape the <class>, should be the first line.
... | def _repr_html_(self):
"""
Return a html representation for a particular DataFrame.
Mainly for IPython notebook.
"""
if self._info_repr():
buf = StringIO("")
self.info(buf=buf)
# need to escape the <class>, should be the first line.
... | [
"Return",
"a",
"html",
"representation",
"for",
"a",
"particular",
"DataFrame",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L635-L657 | [
"def",
"_repr_html_",
"(",
"self",
")",
":",
"if",
"self",
".",
"_info_repr",
"(",
")",
":",
"buf",
"=",
"StringIO",
"(",
"\"\"",
")",
"self",
".",
"info",
"(",
"buf",
"=",
"buf",
")",
"# need to escape the <class>, should be the first line.",
"val",
"=",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_string | Render a DataFrame to a console-friendly tabular output.
%(shared_params)s
line_width : int, optional
Width to wrap a line in characters.
%(returns)s
See Also
--------
to_html : Convert DataFrame to HTML.
Examples
--------
>>> d = {'co... | pandas/core/frame.py | def to_string(self, buf=None, columns=None, col_space=None, header=True,
index=True, na_rep='NaN', formatters=None, float_format=None,
sparsify=None, index_names=True, justify=None,
max_rows=None, max_cols=None, show_dimensions=False,
decimal='.', ... | def to_string(self, buf=None, columns=None, col_space=None, header=True,
index=True, na_rep='NaN', formatters=None, float_format=None,
sparsify=None, index_names=True, justify=None,
max_rows=None, max_cols=None, show_dimensions=False,
decimal='.', ... | [
"Render",
"a",
"DataFrame",
"to",
"a",
"console",
"-",
"friendly",
"tabular",
"output",
".",
"%",
"(",
"shared_params",
")",
"s",
"line_width",
":",
"int",
"optional",
"Width",
"to",
"wrap",
"a",
"line",
"in",
"characters",
".",
"%",
"(",
"returns",
")",... | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L666-L708 | [
"def",
"to_string",
"(",
"self",
",",
"buf",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"col_space",
"=",
"None",
",",
"header",
"=",
"True",
",",
"index",
"=",
"True",
",",
"na_rep",
"=",
"'NaN'",
",",
"formatters",
"=",
"None",
",",
"float_form... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.iteritems | r"""
Iterator over (column name, Series) pairs.
Iterates over the DataFrame columns, returning a tuple with
the column name and the content as a Series.
Yields
------
label : object
The column names for the DataFrame being iterated over.
content : Se... | pandas/core/frame.py | def iteritems(self):
r"""
Iterator over (column name, Series) pairs.
Iterates over the DataFrame columns, returning a tuple with
the column name and the content as a Series.
Yields
------
label : object
The column names for the DataFrame being iterat... | def iteritems(self):
r"""
Iterator over (column name, Series) pairs.
Iterates over the DataFrame columns, returning a tuple with
the column name and the content as a Series.
Yields
------
label : object
The column names for the DataFrame being iterat... | [
"r",
"Iterator",
"over",
"(",
"column",
"name",
"Series",
")",
"pairs",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L725-L778 | [
"def",
"iteritems",
"(",
"self",
")",
":",
"if",
"self",
".",
"columns",
".",
"is_unique",
"and",
"hasattr",
"(",
"self",
",",
"'_item_cache'",
")",
":",
"for",
"k",
"in",
"self",
".",
"columns",
":",
"yield",
"k",
",",
"self",
".",
"_get_item_cache",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.iterrows | Iterate over DataFrame rows as (index, Series) pairs.
Yields
------
index : label or tuple of label
The index of the row. A tuple for a `MultiIndex`.
data : Series
The data of the row as a Series.
it : generator
A generator that iterates over... | pandas/core/frame.py | def iterrows(self):
"""
Iterate over DataFrame rows as (index, Series) pairs.
Yields
------
index : label or tuple of label
The index of the row. A tuple for a `MultiIndex`.
data : Series
The data of the row as a Series.
it : generator
... | def iterrows(self):
"""
Iterate over DataFrame rows as (index, Series) pairs.
Yields
------
index : label or tuple of label
The index of the row. A tuple for a `MultiIndex`.
data : Series
The data of the row as a Series.
it : generator
... | [
"Iterate",
"over",
"DataFrame",
"rows",
"as",
"(",
"index",
"Series",
")",
"pairs",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L780-L830 | [
"def",
"iterrows",
"(",
"self",
")",
":",
"columns",
"=",
"self",
".",
"columns",
"klass",
"=",
"self",
".",
"_constructor_sliced",
"for",
"k",
",",
"v",
"in",
"zip",
"(",
"self",
".",
"index",
",",
"self",
".",
"values",
")",
":",
"s",
"=",
"klass... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.itertuples | Iterate over DataFrame rows as namedtuples.
Parameters
----------
index : bool, default True
If True, return the index as the first element of the tuple.
name : str or None, default "Pandas"
The name of the returned namedtuples or None to return regular
... | pandas/core/frame.py | def itertuples(self, index=True, name="Pandas"):
"""
Iterate over DataFrame rows as namedtuples.
Parameters
----------
index : bool, default True
If True, return the index as the first element of the tuple.
name : str or None, default "Pandas"
The... | def itertuples(self, index=True, name="Pandas"):
"""
Iterate over DataFrame rows as namedtuples.
Parameters
----------
index : bool, default True
If True, return the index as the first element of the tuple.
name : str or None, default "Pandas"
The... | [
"Iterate",
"over",
"DataFrame",
"rows",
"as",
"namedtuples",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L832-L910 | [
"def",
"itertuples",
"(",
"self",
",",
"index",
"=",
"True",
",",
"name",
"=",
"\"Pandas\"",
")",
":",
"arrays",
"=",
"[",
"]",
"fields",
"=",
"list",
"(",
"self",
".",
"columns",
")",
"if",
"index",
":",
"arrays",
".",
"append",
"(",
"self",
".",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.dot | Compute the matrix mutiplication between the DataFrame and other.
This method computes the matrix product between the DataFrame and the
values of an other Series, DataFrame or a numpy array.
It can also be called using ``self @ other`` in Python >= 3.5.
Parameters
----------
... | pandas/core/frame.py | def dot(self, other):
"""
Compute the matrix mutiplication between the DataFrame and other.
This method computes the matrix product between the DataFrame and the
values of an other Series, DataFrame or a numpy array.
It can also be called using ``self @ other`` in Python >= 3.5... | def dot(self, other):
"""
Compute the matrix mutiplication between the DataFrame and other.
This method computes the matrix product between the DataFrame and the
values of an other Series, DataFrame or a numpy array.
It can also be called using ``self @ other`` in Python >= 3.5... | [
"Compute",
"the",
"matrix",
"mutiplication",
"between",
"the",
"DataFrame",
"and",
"other",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L920-L1018 | [
"def",
"dot",
"(",
"self",
",",
"other",
")",
":",
"if",
"isinstance",
"(",
"other",
",",
"(",
"Series",
",",
"DataFrame",
")",
")",
":",
"common",
"=",
"self",
".",
"columns",
".",
"union",
"(",
"other",
".",
"index",
")",
"if",
"(",
"len",
"(",... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.from_dict | Construct DataFrame from dict of array-like or dicts.
Creates DataFrame object from dictionary by columns or by index
allowing dtype specification.
Parameters
----------
data : dict
Of the form {field : array-like} or {field : dict}.
orient : {'columns', 'in... | pandas/core/frame.py | def from_dict(cls, data, orient='columns', dtype=None, columns=None):
"""
Construct DataFrame from dict of array-like or dicts.
Creates DataFrame object from dictionary by columns or by index
allowing dtype specification.
Parameters
----------
data : dict
... | def from_dict(cls, data, orient='columns', dtype=None, columns=None):
"""
Construct DataFrame from dict of array-like or dicts.
Creates DataFrame object from dictionary by columns or by index
allowing dtype specification.
Parameters
----------
data : dict
... | [
"Construct",
"DataFrame",
"from",
"dict",
"of",
"array",
"-",
"like",
"or",
"dicts",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1036-L1115 | [
"def",
"from_dict",
"(",
"cls",
",",
"data",
",",
"orient",
"=",
"'columns'",
",",
"dtype",
"=",
"None",
",",
"columns",
"=",
"None",
")",
":",
"index",
"=",
"None",
"orient",
"=",
"orient",
".",
"lower",
"(",
")",
"if",
"orient",
"==",
"'index'",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_numpy | Convert the DataFrame to a NumPy array.
.. versionadded:: 0.24.0
By default, the dtype of the returned array will be the common NumPy
dtype of all types in the DataFrame. For example, if the dtypes are
``float16`` and ``float32``, the results dtype will be ``float32``.
This may... | pandas/core/frame.py | def to_numpy(self, dtype=None, copy=False):
"""
Convert the DataFrame to a NumPy array.
.. versionadded:: 0.24.0
By default, the dtype of the returned array will be the common NumPy
dtype of all types in the DataFrame. For example, if the dtypes are
``float16`` and ``fl... | def to_numpy(self, dtype=None, copy=False):
"""
Convert the DataFrame to a NumPy array.
.. versionadded:: 0.24.0
By default, the dtype of the returned array will be the common NumPy
dtype of all types in the DataFrame. For example, if the dtypes are
``float16`` and ``fl... | [
"Convert",
"the",
"DataFrame",
"to",
"a",
"NumPy",
"array",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1117-L1170 | [
"def",
"to_numpy",
"(",
"self",
",",
"dtype",
"=",
"None",
",",
"copy",
"=",
"False",
")",
":",
"result",
"=",
"np",
".",
"array",
"(",
"self",
".",
"values",
",",
"dtype",
"=",
"dtype",
",",
"copy",
"=",
"copy",
")",
"return",
"result"
] | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_dict | Convert the DataFrame to a dictionary.
The type of the key-value pairs can be customized with the parameters
(see below).
Parameters
----------
orient : str {'dict', 'list', 'series', 'split', 'records', 'index'}
Determines the type of the values of the dictionary.
... | pandas/core/frame.py | def to_dict(self, orient='dict', into=dict):
"""
Convert the DataFrame to a dictionary.
The type of the key-value pairs can be customized with the parameters
(see below).
Parameters
----------
orient : str {'dict', 'list', 'series', 'split', 'records', 'index'}
... | def to_dict(self, orient='dict', into=dict):
"""
Convert the DataFrame to a dictionary.
The type of the key-value pairs can be customized with the parameters
(see below).
Parameters
----------
orient : str {'dict', 'list', 'series', 'split', 'records', 'index'}
... | [
"Convert",
"the",
"DataFrame",
"to",
"a",
"dictionary",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1172-L1298 | [
"def",
"to_dict",
"(",
"self",
",",
"orient",
"=",
"'dict'",
",",
"into",
"=",
"dict",
")",
":",
"if",
"not",
"self",
".",
"columns",
".",
"is_unique",
":",
"warnings",
".",
"warn",
"(",
"\"DataFrame columns are not unique, some \"",
"\"columns will be omitted.\... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_gbq | Write a DataFrame to a Google BigQuery table.
This function requires the `pandas-gbq package
<https://pandas-gbq.readthedocs.io>`__.
See the `How to authenticate with Google BigQuery
<https://pandas-gbq.readthedocs.io/en/latest/howto/authentication.html>`__
guide for authentica... | pandas/core/frame.py | def to_gbq(self, destination_table, project_id=None, chunksize=None,
reauth=False, if_exists='fail', auth_local_webserver=False,
table_schema=None, location=None, progress_bar=True,
credentials=None, verbose=None, private_key=None):
"""
Write a DataFrame to a... | def to_gbq(self, destination_table, project_id=None, chunksize=None,
reauth=False, if_exists='fail', auth_local_webserver=False,
table_schema=None, location=None, progress_bar=True,
credentials=None, verbose=None, private_key=None):
"""
Write a DataFrame to a... | [
"Write",
"a",
"DataFrame",
"to",
"a",
"Google",
"BigQuery",
"table",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1300-L1405 | [
"def",
"to_gbq",
"(",
"self",
",",
"destination_table",
",",
"project_id",
"=",
"None",
",",
"chunksize",
"=",
"None",
",",
"reauth",
"=",
"False",
",",
"if_exists",
"=",
"'fail'",
",",
"auth_local_webserver",
"=",
"False",
",",
"table_schema",
"=",
"None",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.from_records | Convert structured or record ndarray to DataFrame.
Parameters
----------
data : ndarray (structured dtype), list of tuples, dict, or DataFrame
index : string, list of fields, array-like
Field of array to use as the index, alternately a specific set of
input label... | pandas/core/frame.py | def from_records(cls, data, index=None, exclude=None, columns=None,
coerce_float=False, nrows=None):
"""
Convert structured or record ndarray to DataFrame.
Parameters
----------
data : ndarray (structured dtype), list of tuples, dict, or DataFrame
in... | def from_records(cls, data, index=None, exclude=None, columns=None,
coerce_float=False, nrows=None):
"""
Convert structured or record ndarray to DataFrame.
Parameters
----------
data : ndarray (structured dtype), list of tuples, dict, or DataFrame
in... | [
"Convert",
"structured",
"or",
"record",
"ndarray",
"to",
"DataFrame",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1408-L1533 | [
"def",
"from_records",
"(",
"cls",
",",
"data",
",",
"index",
"=",
"None",
",",
"exclude",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"coerce_float",
"=",
"False",
",",
"nrows",
"=",
"None",
")",
":",
"# Make a copy of the input columns so we can modify it... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_records | Convert DataFrame to a NumPy record array.
Index will be included as the first field of the record array if
requested.
Parameters
----------
index : bool, default True
Include index in resulting record array, stored in 'index'
field or using the index la... | pandas/core/frame.py | def to_records(self, index=True, convert_datetime64=None,
column_dtypes=None, index_dtypes=None):
"""
Convert DataFrame to a NumPy record array.
Index will be included as the first field of the record array if
requested.
Parameters
----------
... | def to_records(self, index=True, convert_datetime64=None,
column_dtypes=None, index_dtypes=None):
"""
Convert DataFrame to a NumPy record array.
Index will be included as the first field of the record array if
requested.
Parameters
----------
... | [
"Convert",
"DataFrame",
"to",
"a",
"NumPy",
"record",
"array",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1535-L1717 | [
"def",
"to_records",
"(",
"self",
",",
"index",
"=",
"True",
",",
"convert_datetime64",
"=",
"None",
",",
"column_dtypes",
"=",
"None",
",",
"index_dtypes",
"=",
"None",
")",
":",
"if",
"convert_datetime64",
"is",
"not",
"None",
":",
"warnings",
".",
"warn... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.from_items | Construct a DataFrame from a list of tuples.
.. deprecated:: 0.23.0
`from_items` is deprecated and will be removed in a future version.
Use :meth:`DataFrame.from_dict(dict(items)) <DataFrame.from_dict>`
instead.
:meth:`DataFrame.from_dict(OrderedDict(items)) <DataFrame.f... | pandas/core/frame.py | def from_items(cls, items, columns=None, orient='columns'):
"""
Construct a DataFrame from a list of tuples.
.. deprecated:: 0.23.0
`from_items` is deprecated and will be removed in a future version.
Use :meth:`DataFrame.from_dict(dict(items)) <DataFrame.from_dict>`
... | def from_items(cls, items, columns=None, orient='columns'):
"""
Construct a DataFrame from a list of tuples.
.. deprecated:: 0.23.0
`from_items` is deprecated and will be removed in a future version.
Use :meth:`DataFrame.from_dict(dict(items)) <DataFrame.from_dict>`
... | [
"Construct",
"a",
"DataFrame",
"from",
"a",
"list",
"of",
"tuples",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1720-L1805 | [
"def",
"from_items",
"(",
"cls",
",",
"items",
",",
"columns",
"=",
"None",
",",
"orient",
"=",
"'columns'",
")",
":",
"warnings",
".",
"warn",
"(",
"\"from_items is deprecated. Please use \"",
"\"DataFrame.from_dict(dict(items), ...) instead. \"",
"\"DataFrame.from_dict(... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.from_csv | Read CSV file.
.. deprecated:: 0.21.0
Use :func:`read_csv` instead.
It is preferable to use the more powerful :func:`read_csv`
for most general purposes, but ``from_csv`` makes for an easy
roundtrip to and from a file (the exact counterpart of
``to_csv``), especiall... | pandas/core/frame.py | def from_csv(cls, path, header=0, sep=',', index_col=0, parse_dates=True,
encoding=None, tupleize_cols=None,
infer_datetime_format=False):
"""
Read CSV file.
.. deprecated:: 0.21.0
Use :func:`read_csv` instead.
It is preferable to use the m... | def from_csv(cls, path, header=0, sep=',', index_col=0, parse_dates=True,
encoding=None, tupleize_cols=None,
infer_datetime_format=False):
"""
Read CSV file.
.. deprecated:: 0.21.0
Use :func:`read_csv` instead.
It is preferable to use the m... | [
"Read",
"CSV",
"file",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1813-L1877 | [
"def",
"from_csv",
"(",
"cls",
",",
"path",
",",
"header",
"=",
"0",
",",
"sep",
"=",
"','",
",",
"index_col",
"=",
"0",
",",
"parse_dates",
"=",
"True",
",",
"encoding",
"=",
"None",
",",
"tupleize_cols",
"=",
"None",
",",
"infer_datetime_format",
"="... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_sparse | Convert to SparseDataFrame.
Implement the sparse version of the DataFrame meaning that any data
matching a specific value it's omitted in the representation.
The sparse DataFrame allows for a more efficient storage.
Parameters
----------
fill_value : float, default None... | pandas/core/frame.py | def to_sparse(self, fill_value=None, kind='block'):
"""
Convert to SparseDataFrame.
Implement the sparse version of the DataFrame meaning that any data
matching a specific value it's omitted in the representation.
The sparse DataFrame allows for a more efficient storage.
... | def to_sparse(self, fill_value=None, kind='block'):
"""
Convert to SparseDataFrame.
Implement the sparse version of the DataFrame meaning that any data
matching a specific value it's omitted in the representation.
The sparse DataFrame allows for a more efficient storage.
... | [
"Convert",
"to",
"SparseDataFrame",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1879-L1936 | [
"def",
"to_sparse",
"(",
"self",
",",
"fill_value",
"=",
"None",
",",
"kind",
"=",
"'block'",
")",
":",
"from",
"pandas",
".",
"core",
".",
"sparse",
".",
"api",
"import",
"SparseDataFrame",
"return",
"SparseDataFrame",
"(",
"self",
".",
"_series",
",",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_stata | Export DataFrame object to Stata dta format.
Writes the DataFrame to a Stata dataset file.
"dta" files contain a Stata dataset.
Parameters
----------
fname : str, buffer or path object
String, path object (pathlib.Path or py._path.local.LocalPath) or
obj... | pandas/core/frame.py | def to_stata(self, fname, convert_dates=None, write_index=True,
encoding="latin-1", byteorder=None, time_stamp=None,
data_label=None, variable_labels=None, version=114,
convert_strl=None):
"""
Export DataFrame object to Stata dta format.
Writes... | def to_stata(self, fname, convert_dates=None, write_index=True,
encoding="latin-1", byteorder=None, time_stamp=None,
data_label=None, variable_labels=None, version=114,
convert_strl=None):
"""
Export DataFrame object to Stata dta format.
Writes... | [
"Export",
"DataFrame",
"object",
"to",
"Stata",
"dta",
"format",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L1955-L2055 | [
"def",
"to_stata",
"(",
"self",
",",
"fname",
",",
"convert_dates",
"=",
"None",
",",
"write_index",
"=",
"True",
",",
"encoding",
"=",
"\"latin-1\"",
",",
"byteorder",
"=",
"None",
",",
"time_stamp",
"=",
"None",
",",
"data_label",
"=",
"None",
",",
"va... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_feather | Write out the binary feather-format for DataFrames.
.. versionadded:: 0.20.0
Parameters
----------
fname : str
string file path | pandas/core/frame.py | def to_feather(self, fname):
"""
Write out the binary feather-format for DataFrames.
.. versionadded:: 0.20.0
Parameters
----------
fname : str
string file path
"""
from pandas.io.feather_format import to_feather
to_feather(self, fnam... | def to_feather(self, fname):
"""
Write out the binary feather-format for DataFrames.
.. versionadded:: 0.20.0
Parameters
----------
fname : str
string file path
"""
from pandas.io.feather_format import to_feather
to_feather(self, fnam... | [
"Write",
"out",
"the",
"binary",
"feather",
"-",
"format",
"for",
"DataFrames",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2057-L2069 | [
"def",
"to_feather",
"(",
"self",
",",
"fname",
")",
":",
"from",
"pandas",
".",
"io",
".",
"feather_format",
"import",
"to_feather",
"to_feather",
"(",
"self",
",",
"fname",
")"
] | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_parquet | Write a DataFrame to the binary parquet format.
.. versionadded:: 0.21.0
This function writes the dataframe as a `parquet file
<https://parquet.apache.org/>`_. You can choose different parquet
backends, and have the option of compression. See
:ref:`the user guide <io.parquet>` ... | pandas/core/frame.py | def to_parquet(self, fname, engine='auto', compression='snappy',
index=None, partition_cols=None, **kwargs):
"""
Write a DataFrame to the binary parquet format.
.. versionadded:: 0.21.0
This function writes the dataframe as a `parquet file
<https://parquet.ap... | def to_parquet(self, fname, engine='auto', compression='snappy',
index=None, partition_cols=None, **kwargs):
"""
Write a DataFrame to the binary parquet format.
.. versionadded:: 0.21.0
This function writes the dataframe as a `parquet file
<https://parquet.ap... | [
"Write",
"a",
"DataFrame",
"to",
"the",
"binary",
"parquet",
"format",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2071-L2141 | [
"def",
"to_parquet",
"(",
"self",
",",
"fname",
",",
"engine",
"=",
"'auto'",
",",
"compression",
"=",
"'snappy'",
",",
"index",
"=",
"None",
",",
"partition_cols",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"pandas",
".",
"io",
".",
"pa... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.to_html | Render a DataFrame as an HTML table.
%(shared_params)s
bold_rows : bool, default True
Make the row labels bold in the output.
classes : str or list or tuple, default None
CSS class(es) to apply to the resulting html table.
escape : bool, default True
C... | pandas/core/frame.py | def to_html(self, buf=None, columns=None, col_space=None, header=True,
index=True, na_rep='NaN', formatters=None, float_format=None,
sparsify=None, index_names=True, justify=None, max_rows=None,
max_cols=None, show_dimensions=False, decimal='.',
bold_rows=... | def to_html(self, buf=None, columns=None, col_space=None, header=True,
index=True, na_rep='NaN', formatters=None, float_format=None,
sparsify=None, index_names=True, justify=None, max_rows=None,
max_cols=None, show_dimensions=False, decimal='.',
bold_rows=... | [
"Render",
"a",
"DataFrame",
"as",
"an",
"HTML",
"table",
".",
"%",
"(",
"shared_params",
")",
"s",
"bold_rows",
":",
"bool",
"default",
"True",
"Make",
"the",
"row",
"labels",
"bold",
"in",
"the",
"output",
".",
"classes",
":",
"str",
"or",
"list",
"or... | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2151-L2210 | [
"def",
"to_html",
"(",
"self",
",",
"buf",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"col_space",
"=",
"None",
",",
"header",
"=",
"True",
",",
"index",
"=",
"True",
",",
"na_rep",
"=",
"'NaN'",
",",
"formatters",
"=",
"None",
",",
"float_format... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.info | Print a concise summary of a DataFrame.
This method prints information about a DataFrame including
the index dtype and column dtypes, non-null values and memory usage.
Parameters
----------
verbose : bool, optional
Whether to print the full summary. By default, the ... | pandas/core/frame.py | def info(self, verbose=None, buf=None, max_cols=None, memory_usage=None,
null_counts=None):
"""
Print a concise summary of a DataFrame.
This method prints information about a DataFrame including
the index dtype and column dtypes, non-null values and memory usage.
P... | def info(self, verbose=None, buf=None, max_cols=None, memory_usage=None,
null_counts=None):
"""
Print a concise summary of a DataFrame.
This method prints information about a DataFrame including
the index dtype and column dtypes, non-null values and memory usage.
P... | [
"Print",
"a",
"concise",
"summary",
"of",
"a",
"DataFrame",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2214-L2451 | [
"def",
"info",
"(",
"self",
",",
"verbose",
"=",
"None",
",",
"buf",
"=",
"None",
",",
"max_cols",
"=",
"None",
",",
"memory_usage",
"=",
"None",
",",
"null_counts",
"=",
"None",
")",
":",
"if",
"buf",
"is",
"None",
":",
"# pragma: no cover",
"buf",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.memory_usage | Return the memory usage of each column in bytes.
The memory usage can optionally include the contribution of
the index and elements of `object` dtype.
This value is displayed in `DataFrame.info` by default. This can be
suppressed by setting ``pandas.options.display.memory_usage`` to Fa... | pandas/core/frame.py | def memory_usage(self, index=True, deep=False):
"""
Return the memory usage of each column in bytes.
The memory usage can optionally include the contribution of
the index and elements of `object` dtype.
This value is displayed in `DataFrame.info` by default. This can be
... | def memory_usage(self, index=True, deep=False):
"""
Return the memory usage of each column in bytes.
The memory usage can optionally include the contribution of
the index and elements of `object` dtype.
This value is displayed in `DataFrame.info` by default. This can be
... | [
"Return",
"the",
"memory",
"usage",
"of",
"each",
"column",
"in",
"bytes",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2453-L2542 | [
"def",
"memory_usage",
"(",
"self",
",",
"index",
"=",
"True",
",",
"deep",
"=",
"False",
")",
":",
"result",
"=",
"Series",
"(",
"[",
"c",
".",
"memory_usage",
"(",
"index",
"=",
"False",
",",
"deep",
"=",
"deep",
")",
"for",
"col",
",",
"c",
"i... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.transpose | Transpose index and columns.
Reflect the DataFrame over its main diagonal by writing rows as columns
and vice-versa. The property :attr:`.T` is an accessor to the method
:meth:`transpose`.
Parameters
----------
copy : bool, default False
If True, the underly... | pandas/core/frame.py | def transpose(self, *args, **kwargs):
"""
Transpose index and columns.
Reflect the DataFrame over its main diagonal by writing rows as columns
and vice-versa. The property :attr:`.T` is an accessor to the method
:meth:`transpose`.
Parameters
----------
c... | def transpose(self, *args, **kwargs):
"""
Transpose index and columns.
Reflect the DataFrame over its main diagonal by writing rows as columns
and vice-versa. The property :attr:`.T` is an accessor to the method
:meth:`transpose`.
Parameters
----------
c... | [
"Transpose",
"index",
"and",
"columns",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2544-L2640 | [
"def",
"transpose",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"nv",
".",
"validate_transpose",
"(",
"args",
",",
"dict",
"(",
")",
")",
"return",
"super",
"(",
")",
".",
"transpose",
"(",
"1",
",",
"0",
",",
"*",
"*",
"k... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.get_value | Quickly retrieve single value at passed column and index.
.. deprecated:: 0.21.0
Use .at[] or .iat[] accessors instead.
Parameters
----------
index : row label
col : column label
takeable : interpret the index/col as indexers, default False
Returns
... | pandas/core/frame.py | def get_value(self, index, col, takeable=False):
"""
Quickly retrieve single value at passed column and index.
.. deprecated:: 0.21.0
Use .at[] or .iat[] accessors instead.
Parameters
----------
index : row label
col : column label
takeable :... | def get_value(self, index, col, takeable=False):
"""
Quickly retrieve single value at passed column and index.
.. deprecated:: 0.21.0
Use .at[] or .iat[] accessors instead.
Parameters
----------
index : row label
col : column label
takeable :... | [
"Quickly",
"retrieve",
"single",
"value",
"at",
"passed",
"column",
"and",
"index",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2679-L2701 | [
"def",
"get_value",
"(",
"self",
",",
"index",
",",
"col",
",",
"takeable",
"=",
"False",
")",
":",
"warnings",
".",
"warn",
"(",
"\"get_value is deprecated and will be removed \"",
"\"in a future release. Please use \"",
"\".at[] or .iat[] accessors instead\"",
",",
"Fut... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.set_value | Put single value at passed column and index.
.. deprecated:: 0.21.0
Use .at[] or .iat[] accessors instead.
Parameters
----------
index : row label
col : column label
value : scalar
takeable : interpret the index/col as indexers, default False
... | pandas/core/frame.py | def set_value(self, index, col, value, takeable=False):
"""
Put single value at passed column and index.
.. deprecated:: 0.21.0
Use .at[] or .iat[] accessors instead.
Parameters
----------
index : row label
col : column label
value : scalar
... | def set_value(self, index, col, value, takeable=False):
"""
Put single value at passed column and index.
.. deprecated:: 0.21.0
Use .at[] or .iat[] accessors instead.
Parameters
----------
index : row label
col : column label
value : scalar
... | [
"Put",
"single",
"value",
"at",
"passed",
"column",
"and",
"index",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2723-L2747 | [
"def",
"set_value",
"(",
"self",
",",
"index",
",",
"col",
",",
"value",
",",
"takeable",
"=",
"False",
")",
":",
"warnings",
".",
"warn",
"(",
"\"set_value is deprecated and will be removed \"",
"\"in a future release. Please use \"",
"\".at[] or .iat[] accessors instead... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame._ixs | Parameters
----------
i : int, slice, or sequence of integers
axis : int
Notes
-----
If slice passed, the resulting data will be a view. | pandas/core/frame.py | def _ixs(self, i, axis=0):
"""
Parameters
----------
i : int, slice, or sequence of integers
axis : int
Notes
-----
If slice passed, the resulting data will be a view.
"""
# irow
if axis == 0:
if isinstance(i, slice):
... | def _ixs(self, i, axis=0):
"""
Parameters
----------
i : int, slice, or sequence of integers
axis : int
Notes
-----
If slice passed, the resulting data will be a view.
"""
# irow
if axis == 0:
if isinstance(i, slice):
... | [
"Parameters",
"----------",
"i",
":",
"int",
"slice",
"or",
"sequence",
"of",
"integers",
"axis",
":",
"int"
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2771-L2833 | [
"def",
"_ixs",
"(",
"self",
",",
"i",
",",
"axis",
"=",
"0",
")",
":",
"# irow",
"if",
"axis",
"==",
"0",
":",
"if",
"isinstance",
"(",
"i",
",",
"slice",
")",
":",
"return",
"self",
"[",
"i",
"]",
"else",
":",
"label",
"=",
"self",
".",
"ind... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.query | Query the columns of a DataFrame with a boolean expression.
Parameters
----------
expr : str
The query string to evaluate. You can refer to variables
in the environment by prefixing them with an '@' character like
``@a + b``.
.. versionadded:: 0... | pandas/core/frame.py | def query(self, expr, inplace=False, **kwargs):
"""
Query the columns of a DataFrame with a boolean expression.
Parameters
----------
expr : str
The query string to evaluate. You can refer to variables
in the environment by prefixing them with an '@' cha... | def query(self, expr, inplace=False, **kwargs):
"""
Query the columns of a DataFrame with a boolean expression.
Parameters
----------
expr : str
The query string to evaluate. You can refer to variables
in the environment by prefixing them with an '@' cha... | [
"Query",
"the",
"columns",
"of",
"a",
"DataFrame",
"with",
"a",
"boolean",
"expression",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L2955-L3082 | [
"def",
"query",
"(",
"self",
",",
"expr",
",",
"inplace",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"'inplace'",
")",
"if",
"not",
"isinstance",
"(",
"expr",
",",
"str",
")",
":",
"ms... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.eval | Evaluate a string describing operations on DataFrame columns.
Operates on columns only, not specific rows or elements. This allows
`eval` to run arbitrary code, which can make you vulnerable to code
injection if you pass user input to this function.
Parameters
----------
... | pandas/core/frame.py | def eval(self, expr, inplace=False, **kwargs):
"""
Evaluate a string describing operations on DataFrame columns.
Operates on columns only, not specific rows or elements. This allows
`eval` to run arbitrary code, which can make you vulnerable to code
injection if you pass user i... | def eval(self, expr, inplace=False, **kwargs):
"""
Evaluate a string describing operations on DataFrame columns.
Operates on columns only, not specific rows or elements. This allows
`eval` to run arbitrary code, which can make you vulnerable to code
injection if you pass user i... | [
"Evaluate",
"a",
"string",
"describing",
"operations",
"on",
"DataFrame",
"columns",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3084-L3187 | [
"def",
"eval",
"(",
"self",
",",
"expr",
",",
"inplace",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"from",
"pandas",
".",
"core",
".",
"computation",
".",
"eval",
"import",
"eval",
"as",
"_eval",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inpl... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.select_dtypes | Return a subset of the DataFrame's columns based on the column dtypes.
Parameters
----------
include, exclude : scalar or list-like
A selection of dtypes or strings to be included/excluded. At least
one of these parameters must be supplied.
Returns
-----... | pandas/core/frame.py | def select_dtypes(self, include=None, exclude=None):
"""
Return a subset of the DataFrame's columns based on the column dtypes.
Parameters
----------
include, exclude : scalar or list-like
A selection of dtypes or strings to be included/excluded. At least
... | def select_dtypes(self, include=None, exclude=None):
"""
Return a subset of the DataFrame's columns based on the column dtypes.
Parameters
----------
include, exclude : scalar or list-like
A selection of dtypes or strings to be included/excluded. At least
... | [
"Return",
"a",
"subset",
"of",
"the",
"DataFrame",
"s",
"columns",
"based",
"on",
"the",
"column",
"dtypes",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3189-L3324 | [
"def",
"select_dtypes",
"(",
"self",
",",
"include",
"=",
"None",
",",
"exclude",
"=",
"None",
")",
":",
"def",
"_get_info_slice",
"(",
"obj",
",",
"indexer",
")",
":",
"\"\"\"Slice the info axis of `obj` with `indexer`.\"\"\"",
"if",
"not",
"hasattr",
"(",
"obj... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame._box_col_values | Provide boxed values for a column. | pandas/core/frame.py | def _box_col_values(self, values, items):
"""
Provide boxed values for a column.
"""
klass = self._constructor_sliced
return klass(values, index=self.index, name=items, fastpath=True) | def _box_col_values(self, values, items):
"""
Provide boxed values for a column.
"""
klass = self._constructor_sliced
return klass(values, index=self.index, name=items, fastpath=True) | [
"Provide",
"boxed",
"values",
"for",
"a",
"column",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3333-L3338 | [
"def",
"_box_col_values",
"(",
"self",
",",
"values",
",",
"items",
")",
":",
"klass",
"=",
"self",
".",
"_constructor_sliced",
"return",
"klass",
"(",
"values",
",",
"index",
"=",
"self",
".",
"index",
",",
"name",
"=",
"items",
",",
"fastpath",
"=",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame._ensure_valid_index | Ensure that if we don't have an index, that we can create one from the
passed value. | pandas/core/frame.py | def _ensure_valid_index(self, value):
"""
Ensure that if we don't have an index, that we can create one from the
passed value.
"""
# GH5632, make sure that we are a Series convertible
if not len(self.index) and is_list_like(value):
try:
value =... | def _ensure_valid_index(self, value):
"""
Ensure that if we don't have an index, that we can create one from the
passed value.
"""
# GH5632, make sure that we are a Series convertible
if not len(self.index) and is_list_like(value):
try:
value =... | [
"Ensure",
"that",
"if",
"we",
"don",
"t",
"have",
"an",
"index",
"that",
"we",
"can",
"create",
"one",
"from",
"the",
"passed",
"value",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3400-L3415 | [
"def",
"_ensure_valid_index",
"(",
"self",
",",
"value",
")",
":",
"# GH5632, make sure that we are a Series convertible",
"if",
"not",
"len",
"(",
"self",
".",
"index",
")",
"and",
"is_list_like",
"(",
"value",
")",
":",
"try",
":",
"value",
"=",
"Series",
"(... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame._set_item | Add series to DataFrame in specified column.
If series is a numpy-array (not a Series/TimeSeries), it must be the
same length as the DataFrames index or an error will be thrown.
Series/TimeSeries will be conformed to the DataFrames index to
ensure homogeneity. | pandas/core/frame.py | def _set_item(self, key, value):
"""
Add series to DataFrame in specified column.
If series is a numpy-array (not a Series/TimeSeries), it must be the
same length as the DataFrames index or an error will be thrown.
Series/TimeSeries will be conformed to the DataFrames index to
... | def _set_item(self, key, value):
"""
Add series to DataFrame in specified column.
If series is a numpy-array (not a Series/TimeSeries), it must be the
same length as the DataFrames index or an error will be thrown.
Series/TimeSeries will be conformed to the DataFrames index to
... | [
"Add",
"series",
"to",
"DataFrame",
"in",
"specified",
"column",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3417-L3436 | [
"def",
"_set_item",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"self",
".",
"_ensure_valid_index",
"(",
"value",
")",
"value",
"=",
"self",
".",
"_sanitize_column",
"(",
"key",
",",
"value",
")",
"NDFrame",
".",
"_set_item",
"(",
"self",
",",
"ke... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.insert | Insert column into DataFrame at specified location.
Raises a ValueError if `column` is already contained in the DataFrame,
unless `allow_duplicates` is set to True.
Parameters
----------
loc : int
Insertion index. Must verify 0 <= loc <= len(columns)
column ... | pandas/core/frame.py | def insert(self, loc, column, value, allow_duplicates=False):
"""
Insert column into DataFrame at specified location.
Raises a ValueError if `column` is already contained in the DataFrame,
unless `allow_duplicates` is set to True.
Parameters
----------
loc : int... | def insert(self, loc, column, value, allow_duplicates=False):
"""
Insert column into DataFrame at specified location.
Raises a ValueError if `column` is already contained in the DataFrame,
unless `allow_duplicates` is set to True.
Parameters
----------
loc : int... | [
"Insert",
"column",
"into",
"DataFrame",
"at",
"specified",
"location",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3438-L3457 | [
"def",
"insert",
"(",
"self",
",",
"loc",
",",
"column",
",",
"value",
",",
"allow_duplicates",
"=",
"False",
")",
":",
"self",
".",
"_ensure_valid_index",
"(",
"value",
")",
"value",
"=",
"self",
".",
"_sanitize_column",
"(",
"column",
",",
"value",
","... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.assign | r"""
Assign new columns to a DataFrame.
Returns a new object with all original columns in addition to new ones.
Existing columns that are re-assigned will be overwritten.
Parameters
----------
**kwargs : dict of {str: callable or Series}
The column names are... | pandas/core/frame.py | def assign(self, **kwargs):
r"""
Assign new columns to a DataFrame.
Returns a new object with all original columns in addition to new ones.
Existing columns that are re-assigned will be overwritten.
Parameters
----------
**kwargs : dict of {str: callable or Seri... | def assign(self, **kwargs):
r"""
Assign new columns to a DataFrame.
Returns a new object with all original columns in addition to new ones.
Existing columns that are re-assigned will be overwritten.
Parameters
----------
**kwargs : dict of {str: callable or Seri... | [
"r",
"Assign",
"new",
"columns",
"to",
"a",
"DataFrame",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3459-L3547 | [
"def",
"assign",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"data",
"=",
"self",
".",
"copy",
"(",
")",
"# >= 3.6 preserve order of kwargs",
"if",
"PY36",
":",
"for",
"k",
",",
"v",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"data",
"[",
"k"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame._sanitize_column | Ensures new columns (which go into the BlockManager as new blocks) are
always copied and converted into an array.
Parameters
----------
key : object
value : scalar, Series, or array-like
broadcast : bool, default True
If ``key`` matches multiple duplicate col... | pandas/core/frame.py | def _sanitize_column(self, key, value, broadcast=True):
"""
Ensures new columns (which go into the BlockManager as new blocks) are
always copied and converted into an array.
Parameters
----------
key : object
value : scalar, Series, or array-like
broadcas... | def _sanitize_column(self, key, value, broadcast=True):
"""
Ensures new columns (which go into the BlockManager as new blocks) are
always copied and converted into an array.
Parameters
----------
key : object
value : scalar, Series, or array-like
broadcas... | [
"Ensures",
"new",
"columns",
"(",
"which",
"go",
"into",
"the",
"BlockManager",
"as",
"new",
"blocks",
")",
"are",
"always",
"copied",
"and",
"converted",
"into",
"an",
"array",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3549-L3652 | [
"def",
"_sanitize_column",
"(",
"self",
",",
"key",
",",
"value",
",",
"broadcast",
"=",
"True",
")",
":",
"def",
"reindexer",
"(",
"value",
")",
":",
"# reindex if necessary",
"if",
"value",
".",
"index",
".",
"equals",
"(",
"self",
".",
"index",
")",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.lookup | Label-based "fancy indexing" function for DataFrame.
Given equal-length arrays of row and column labels, return an
array of the values corresponding to each (row, col) pair.
Parameters
----------
row_labels : sequence
The row labels to use for lookup
col_lab... | pandas/core/frame.py | def lookup(self, row_labels, col_labels):
"""
Label-based "fancy indexing" function for DataFrame.
Given equal-length arrays of row and column labels, return an
array of the values corresponding to each (row, col) pair.
Parameters
----------
row_labels : sequenc... | def lookup(self, row_labels, col_labels):
"""
Label-based "fancy indexing" function for DataFrame.
Given equal-length arrays of row and column labels, return an
array of the values corresponding to each (row, col) pair.
Parameters
----------
row_labels : sequenc... | [
"Label",
"-",
"based",
"fancy",
"indexing",
"function",
"for",
"DataFrame",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3659-L3708 | [
"def",
"lookup",
"(",
"self",
",",
"row_labels",
",",
"col_labels",
")",
":",
"n",
"=",
"len",
"(",
"row_labels",
")",
"if",
"n",
"!=",
"len",
"(",
"col_labels",
")",
":",
"raise",
"ValueError",
"(",
"'Row labels must have same size as column labels'",
")",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame._reindex_multi | We are guaranteed non-Nones in the axes. | pandas/core/frame.py | def _reindex_multi(self, axes, copy, fill_value):
"""
We are guaranteed non-Nones in the axes.
"""
new_index, row_indexer = self.index.reindex(axes['index'])
new_columns, col_indexer = self.columns.reindex(axes['columns'])
if row_indexer is not None and col_indexer is n... | def _reindex_multi(self, axes, copy, fill_value):
"""
We are guaranteed non-Nones in the axes.
"""
new_index, row_indexer = self.index.reindex(axes['index'])
new_columns, col_indexer = self.columns.reindex(axes['columns'])
if row_indexer is not None and col_indexer is n... | [
"We",
"are",
"guaranteed",
"non",
"-",
"Nones",
"in",
"the",
"axes",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3747-L3765 | [
"def",
"_reindex_multi",
"(",
"self",
",",
"axes",
",",
"copy",
",",
"fill_value",
")",
":",
"new_index",
",",
"row_indexer",
"=",
"self",
".",
"index",
".",
"reindex",
"(",
"axes",
"[",
"'index'",
"]",
")",
"new_columns",
",",
"col_indexer",
"=",
"self"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.drop | Drop specified labels from rows or columns.
Remove rows or columns by specifying label names and corresponding
axis, or by specifying directly index or column names. When using a
multi-index, labels on different levels can be removed by specifying
the level.
Parameters
... | pandas/core/frame.py | def drop(self, labels=None, axis=0, index=None, columns=None,
level=None, inplace=False, errors='raise'):
"""
Drop specified labels from rows or columns.
Remove rows or columns by specifying label names and corresponding
axis, or by specifying directly index or column names... | def drop(self, labels=None, axis=0, index=None, columns=None,
level=None, inplace=False, errors='raise'):
"""
Drop specified labels from rows or columns.
Remove rows or columns by specifying label names and corresponding
axis, or by specifying directly index or column names... | [
"Drop",
"specified",
"labels",
"from",
"rows",
"or",
"columns",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3800-L3926 | [
"def",
"drop",
"(",
"self",
",",
"labels",
"=",
"None",
",",
"axis",
"=",
"0",
",",
"index",
"=",
"None",
",",
"columns",
"=",
"None",
",",
"level",
"=",
"None",
",",
"inplace",
"=",
"False",
",",
"errors",
"=",
"'raise'",
")",
":",
"return",
"su... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.rename | Alter axes labels.
Function / dict values must be unique (1-to-1). Labels not contained in
a dict / Series will be left as-is. Extra labels listed don't throw an
error.
See the :ref:`user guide <basics.rename>` for more.
Parameters
----------
mapper : dict-like... | pandas/core/frame.py | def rename(self, *args, **kwargs):
"""
Alter axes labels.
Function / dict values must be unique (1-to-1). Labels not contained in
a dict / Series will be left as-is. Extra labels listed don't throw an
error.
See the :ref:`user guide <basics.rename>` for more.
P... | def rename(self, *args, **kwargs):
"""
Alter axes labels.
Function / dict values must be unique (1-to-1). Labels not contained in
a dict / Series will be left as-is. Extra labels listed don't throw an
error.
See the :ref:`user guide <basics.rename>` for more.
P... | [
"Alter",
"axes",
"labels",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L3932-L4035 | [
"def",
"rename",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"axes",
"=",
"validate_axis_style_args",
"(",
"self",
",",
"args",
",",
"kwargs",
",",
"'mapper'",
",",
"'rename'",
")",
"kwargs",
".",
"update",
"(",
"axes",
")",
"# ... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.set_index | Set the DataFrame index using existing columns.
Set the DataFrame index (row labels) using one or more existing
columns or arrays (of the correct length). The index can replace the
existing index or expand on it.
Parameters
----------
keys : label or array-like or list ... | pandas/core/frame.py | def set_index(self, keys, drop=True, append=False, inplace=False,
verify_integrity=False):
"""
Set the DataFrame index using existing columns.
Set the DataFrame index (row labels) using one or more existing
columns or arrays (of the correct length). The index can repla... | def set_index(self, keys, drop=True, append=False, inplace=False,
verify_integrity=False):
"""
Set the DataFrame index using existing columns.
Set the DataFrame index (row labels) using one or more existing
columns or arrays (of the correct length). The index can repla... | [
"Set",
"the",
"DataFrame",
"index",
"using",
"existing",
"columns",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L4057-L4242 | [
"def",
"set_index",
"(",
"self",
",",
"keys",
",",
"drop",
"=",
"True",
",",
"append",
"=",
"False",
",",
"inplace",
"=",
"False",
",",
"verify_integrity",
"=",
"False",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"'inplace'",
"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.reset_index | Reset the index, or a level of it.
Reset the index of the DataFrame, and use the default one instead.
If the DataFrame has a MultiIndex, this method can remove one or more
levels.
Parameters
----------
level : int, str, tuple, or list, default None
Only remo... | pandas/core/frame.py | def reset_index(self, level=None, drop=False, inplace=False, col_level=0,
col_fill=''):
"""
Reset the index, or a level of it.
Reset the index of the DataFrame, and use the default one instead.
If the DataFrame has a MultiIndex, this method can remove one or more
... | def reset_index(self, level=None, drop=False, inplace=False, col_level=0,
col_fill=''):
"""
Reset the index, or a level of it.
Reset the index of the DataFrame, and use the default one instead.
If the DataFrame has a MultiIndex, this method can remove one or more
... | [
"Reset",
"the",
"index",
"or",
"a",
"level",
"of",
"it",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L4244-L4476 | [
"def",
"reset_index",
"(",
"self",
",",
"level",
"=",
"None",
",",
"drop",
"=",
"False",
",",
"inplace",
"=",
"False",
",",
"col_level",
"=",
"0",
",",
"col_fill",
"=",
"''",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"'inpla... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.dropna | Remove missing values.
See the :ref:`User Guide <missing_data>` for more on which values are
considered missing, and how to work with missing data.
Parameters
----------
axis : {0 or 'index', 1 or 'columns'}, default 0
Determine if rows or columns which contain miss... | pandas/core/frame.py | def dropna(self, axis=0, how='any', thresh=None, subset=None,
inplace=False):
"""
Remove missing values.
See the :ref:`User Guide <missing_data>` for more on which values are
considered missing, and how to work with missing data.
Parameters
----------
... | def dropna(self, axis=0, how='any', thresh=None, subset=None,
inplace=False):
"""
Remove missing values.
See the :ref:`User Guide <missing_data>` for more on which values are
considered missing, and how to work with missing data.
Parameters
----------
... | [
"Remove",
"missing",
"values",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L4497-L4644 | [
"def",
"dropna",
"(",
"self",
",",
"axis",
"=",
"0",
",",
"how",
"=",
"'any'",
",",
"thresh",
"=",
"None",
",",
"subset",
"=",
"None",
",",
"inplace",
"=",
"False",
")",
":",
"inplace",
"=",
"validate_bool_kwarg",
"(",
"inplace",
",",
"'inplace'",
")... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.drop_duplicates | Return DataFrame with duplicate rows removed, optionally only
considering certain columns. Indexes, including time indexes
are ignored.
Parameters
----------
subset : column label or sequence of labels, optional
Only consider certain columns for identifying duplicate... | pandas/core/frame.py | def drop_duplicates(self, subset=None, keep='first', inplace=False):
"""
Return DataFrame with duplicate rows removed, optionally only
considering certain columns. Indexes, including time indexes
are ignored.
Parameters
----------
subset : column label or sequenc... | def drop_duplicates(self, subset=None, keep='first', inplace=False):
"""
Return DataFrame with duplicate rows removed, optionally only
considering certain columns. Indexes, including time indexes
are ignored.
Parameters
----------
subset : column label or sequenc... | [
"Return",
"DataFrame",
"with",
"duplicate",
"rows",
"removed",
"optionally",
"only",
"considering",
"certain",
"columns",
".",
"Indexes",
"including",
"time",
"indexes",
"are",
"ignored",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L4646-L4679 | [
"def",
"drop_duplicates",
"(",
"self",
",",
"subset",
"=",
"None",
",",
"keep",
"=",
"'first'",
",",
"inplace",
"=",
"False",
")",
":",
"if",
"self",
".",
"empty",
":",
"return",
"self",
".",
"copy",
"(",
")",
"inplace",
"=",
"validate_bool_kwarg",
"("... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.duplicated | Return boolean Series denoting duplicate rows, optionally only
considering certain columns.
Parameters
----------
subset : column label or sequence of labels, optional
Only consider certain columns for identifying duplicates, by
default use all of the columns
... | pandas/core/frame.py | def duplicated(self, subset=None, keep='first'):
"""
Return boolean Series denoting duplicate rows, optionally only
considering certain columns.
Parameters
----------
subset : column label or sequence of labels, optional
Only consider certain columns for iden... | def duplicated(self, subset=None, keep='first'):
"""
Return boolean Series denoting duplicate rows, optionally only
considering certain columns.
Parameters
----------
subset : column label or sequence of labels, optional
Only consider certain columns for iden... | [
"Return",
"boolean",
"Series",
"denoting",
"duplicate",
"rows",
"optionally",
"only",
"considering",
"certain",
"columns",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L4681-L4732 | [
"def",
"duplicated",
"(",
"self",
",",
"subset",
"=",
"None",
",",
"keep",
"=",
"'first'",
")",
":",
"from",
"pandas",
".",
"core",
".",
"sorting",
"import",
"get_group_index",
"from",
"pandas",
".",
"_libs",
".",
"hashtable",
"import",
"duplicated_int64",
... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.nlargest | Return the first `n` rows ordered by `columns` in descending order.
Return the first `n` rows with the largest values in `columns`, in
descending order. The columns that are not specified are returned as
well, but not used for ordering.
This method is equivalent to
``df.sort_va... | pandas/core/frame.py | def nlargest(self, n, columns, keep='first'):
"""
Return the first `n` rows ordered by `columns` in descending order.
Return the first `n` rows with the largest values in `columns`, in
descending order. The columns that are not specified are returned as
well, but not used for or... | def nlargest(self, n, columns, keep='first'):
"""
Return the first `n` rows ordered by `columns` in descending order.
Return the first `n` rows with the largest values in `columns`, in
descending order. The columns that are not specified are returned as
well, but not used for or... | [
"Return",
"the",
"first",
"n",
"rows",
"ordered",
"by",
"columns",
"in",
"descending",
"order",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L4843-L4953 | [
"def",
"nlargest",
"(",
"self",
",",
"n",
",",
"columns",
",",
"keep",
"=",
"'first'",
")",
":",
"return",
"algorithms",
".",
"SelectNFrame",
"(",
"self",
",",
"n",
"=",
"n",
",",
"keep",
"=",
"keep",
",",
"columns",
"=",
"columns",
")",
".",
"nlar... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.nsmallest | Return the first `n` rows ordered by `columns` in ascending order.
Return the first `n` rows with the smallest values in `columns`, in
ascending order. The columns that are not specified are returned as
well, but not used for ordering.
This method is equivalent to
``df.sort_val... | pandas/core/frame.py | def nsmallest(self, n, columns, keep='first'):
"""
Return the first `n` rows ordered by `columns` in ascending order.
Return the first `n` rows with the smallest values in `columns`, in
ascending order. The columns that are not specified are returned as
well, but not used for or... | def nsmallest(self, n, columns, keep='first'):
"""
Return the first `n` rows ordered by `columns` in ascending order.
Return the first `n` rows with the smallest values in `columns`, in
ascending order. The columns that are not specified are returned as
well, but not used for or... | [
"Return",
"the",
"first",
"n",
"rows",
"ordered",
"by",
"columns",
"in",
"ascending",
"order",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L4955-L5055 | [
"def",
"nsmallest",
"(",
"self",
",",
"n",
",",
"columns",
",",
"keep",
"=",
"'first'",
")",
":",
"return",
"algorithms",
".",
"SelectNFrame",
"(",
"self",
",",
"n",
"=",
"n",
",",
"keep",
"=",
"keep",
",",
"columns",
"=",
"columns",
")",
".",
"nsm... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.swaplevel | Swap levels i and j in a MultiIndex on a particular axis.
Parameters
----------
i, j : int, string (can be mixed)
Level of index to be swapped. Can pass level name as string.
Returns
-------
DataFrame
.. versionchanged:: 0.18.1
The index... | pandas/core/frame.py | def swaplevel(self, i=-2, j=-1, axis=0):
"""
Swap levels i and j in a MultiIndex on a particular axis.
Parameters
----------
i, j : int, string (can be mixed)
Level of index to be swapped. Can pass level name as string.
Returns
-------
DataFr... | def swaplevel(self, i=-2, j=-1, axis=0):
"""
Swap levels i and j in a MultiIndex on a particular axis.
Parameters
----------
i, j : int, string (can be mixed)
Level of index to be swapped. Can pass level name as string.
Returns
-------
DataFr... | [
"Swap",
"levels",
"i",
"and",
"j",
"in",
"a",
"MultiIndex",
"on",
"a",
"particular",
"axis",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L5057-L5082 | [
"def",
"swaplevel",
"(",
"self",
",",
"i",
"=",
"-",
"2",
",",
"j",
"=",
"-",
"1",
",",
"axis",
"=",
"0",
")",
":",
"result",
"=",
"self",
".",
"copy",
"(",
")",
"axis",
"=",
"self",
".",
"_get_axis_number",
"(",
"axis",
")",
"if",
"axis",
"=... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.reorder_levels | Rearrange index levels using input order. May not drop or
duplicate levels.
Parameters
----------
order : list of int or list of str
List representing new level order. Reference level by number
(position) or by key (label).
axis : int
Where to... | pandas/core/frame.py | def reorder_levels(self, order, axis=0):
"""
Rearrange index levels using input order. May not drop or
duplicate levels.
Parameters
----------
order : list of int or list of str
List representing new level order. Reference level by number
(positio... | def reorder_levels(self, order, axis=0):
"""
Rearrange index levels using input order. May not drop or
duplicate levels.
Parameters
----------
order : list of int or list of str
List representing new level order. Reference level by number
(positio... | [
"Rearrange",
"index",
"levels",
"using",
"input",
"order",
".",
"May",
"not",
"drop",
"or",
"duplicate",
"levels",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L5084-L5112 | [
"def",
"reorder_levels",
"(",
"self",
",",
"order",
",",
"axis",
"=",
"0",
")",
":",
"axis",
"=",
"self",
".",
"_get_axis_number",
"(",
"axis",
")",
"if",
"not",
"isinstance",
"(",
"self",
".",
"_get_axis",
"(",
"axis",
")",
",",
"MultiIndex",
")",
"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.combine | Perform column-wise combine with another DataFrame.
Combines a DataFrame with `other` DataFrame using `func`
to element-wise combine columns. The row and column indexes of the
resulting DataFrame will be the union of the two.
Parameters
----------
other : DataFrame
... | pandas/core/frame.py | def combine(self, other, func, fill_value=None, overwrite=True):
"""
Perform column-wise combine with another DataFrame.
Combines a DataFrame with `other` DataFrame using `func`
to element-wise combine columns. The row and column indexes of the
resulting DataFrame will be the un... | def combine(self, other, func, fill_value=None, overwrite=True):
"""
Perform column-wise combine with another DataFrame.
Combines a DataFrame with `other` DataFrame using `func`
to element-wise combine columns. The row and column indexes of the
resulting DataFrame will be the un... | [
"Perform",
"column",
"-",
"wise",
"combine",
"with",
"another",
"DataFrame",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L5164-L5330 | [
"def",
"combine",
"(",
"self",
",",
"other",
",",
"func",
",",
"fill_value",
"=",
"None",
",",
"overwrite",
"=",
"True",
")",
":",
"other_idxlen",
"=",
"len",
"(",
"other",
".",
"index",
")",
"# save for compare",
"this",
",",
"other",
"=",
"self",
"."... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.combine_first | Update null elements with value in the same location in `other`.
Combine two DataFrame objects by filling null values in one DataFrame
with non-null values from other DataFrame. The row and column indexes
of the resulting DataFrame will be the union of the two.
Parameters
-----... | pandas/core/frame.py | def combine_first(self, other):
"""
Update null elements with value in the same location in `other`.
Combine two DataFrame objects by filling null values in one DataFrame
with non-null values from other DataFrame. The row and column indexes
of the resulting DataFrame will be the... | def combine_first(self, other):
"""
Update null elements with value in the same location in `other`.
Combine two DataFrame objects by filling null values in one DataFrame
with non-null values from other DataFrame. The row and column indexes
of the resulting DataFrame will be the... | [
"Update",
"null",
"elements",
"with",
"value",
"in",
"the",
"same",
"location",
"in",
"other",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L5332-L5406 | [
"def",
"combine_first",
"(",
"self",
",",
"other",
")",
":",
"import",
"pandas",
".",
"core",
".",
"computation",
".",
"expressions",
"as",
"expressions",
"def",
"extract_values",
"(",
"arr",
")",
":",
"# Does two things:",
"# 1. maybe gets the values from the Serie... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.update | Modify in place using non-NA values from another DataFrame.
Aligns on indices. There is no return value.
Parameters
----------
other : DataFrame, or object coercible into a DataFrame
Should have at least one matching index/column label
with the original DataFram... | pandas/core/frame.py | def update(self, other, join='left', overwrite=True, filter_func=None,
errors='ignore'):
"""
Modify in place using non-NA values from another DataFrame.
Aligns on indices. There is no return value.
Parameters
----------
other : DataFrame, or object coerci... | def update(self, other, join='left', overwrite=True, filter_func=None,
errors='ignore'):
"""
Modify in place using non-NA values from another DataFrame.
Aligns on indices. There is no return value.
Parameters
----------
other : DataFrame, or object coerci... | [
"Modify",
"in",
"place",
"using",
"non",
"-",
"NA",
"values",
"from",
"another",
"DataFrame",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L5410-L5558 | [
"def",
"update",
"(",
"self",
",",
"other",
",",
"join",
"=",
"'left'",
",",
"overwrite",
"=",
"True",
",",
"filter_func",
"=",
"None",
",",
"errors",
"=",
"'ignore'",
")",
":",
"import",
"pandas",
".",
"core",
".",
"computation",
".",
"expressions",
"... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.stack | Stack the prescribed level(s) from columns to index.
Return a reshaped DataFrame or Series having a multi-level
index with one or more new inner-most levels compared to the current
DataFrame. The new inner-most levels are created by pivoting the
columns of the current dataframe:
... | pandas/core/frame.py | def stack(self, level=-1, dropna=True):
"""
Stack the prescribed level(s) from columns to index.
Return a reshaped DataFrame or Series having a multi-level
index with one or more new inner-most levels compared to the current
DataFrame. The new inner-most levels are created by pi... | def stack(self, level=-1, dropna=True):
"""
Stack the prescribed level(s) from columns to index.
Return a reshaped DataFrame or Series having a multi-level
index with one or more new inner-most levels compared to the current
DataFrame. The new inner-most levels are created by pi... | [
"Stack",
"the",
"prescribed",
"level",
"(",
"s",
")",
"from",
"columns",
"to",
"index",
"."
] | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L5808-L5976 | [
"def",
"stack",
"(",
"self",
",",
"level",
"=",
"-",
"1",
",",
"dropna",
"=",
"True",
")",
":",
"from",
"pandas",
".",
"core",
".",
"reshape",
".",
"reshape",
"import",
"stack",
",",
"stack_multiple",
"if",
"isinstance",
"(",
"level",
",",
"(",
"tupl... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
train | DataFrame.unstack | Pivot a level of the (necessarily hierarchical) index labels, returning
a DataFrame having a new level of column labels whose inner-most level
consists of the pivoted index labels.
If the index is not a MultiIndex, the output will be a Series
(the analogue of stack when the columns are ... | pandas/core/frame.py | def unstack(self, level=-1, fill_value=None):
"""
Pivot a level of the (necessarily hierarchical) index labels, returning
a DataFrame having a new level of column labels whose inner-most level
consists of the pivoted index labels.
If the index is not a MultiIndex, the output wil... | def unstack(self, level=-1, fill_value=None):
"""
Pivot a level of the (necessarily hierarchical) index labels, returning
a DataFrame having a new level of column labels whose inner-most level
consists of the pivoted index labels.
If the index is not a MultiIndex, the output wil... | [
"Pivot",
"a",
"level",
"of",
"the",
"(",
"necessarily",
"hierarchical",
")",
"index",
"labels",
"returning",
"a",
"DataFrame",
"having",
"a",
"new",
"level",
"of",
"column",
"labels",
"whose",
"inner",
"-",
"most",
"level",
"consists",
"of",
"the",
"pivoted"... | pandas-dev/pandas | python | https://github.com/pandas-dev/pandas/blob/9feb3ad92cc0397a04b665803a49299ee7aa1037/pandas/core/frame.py#L5978-L6039 | [
"def",
"unstack",
"(",
"self",
",",
"level",
"=",
"-",
"1",
",",
"fill_value",
"=",
"None",
")",
":",
"from",
"pandas",
".",
"core",
".",
"reshape",
".",
"reshape",
"import",
"unstack",
"return",
"unstack",
"(",
"self",
",",
"level",
",",
"fill_value",... | 9feb3ad92cc0397a04b665803a49299ee7aa1037 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.