body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def _repr_data_resource_(self):
'\n Not a real Jupyter special repr method, but we use the same\n naming convention.\n '
if config.get_option('display.html.table_schema'):
data = self.head(config.get_option('display.max_rows'))
payload = json.loads(data.to_json(orient='table... | 2,804,131,655,790,914,600 | Not a real Jupyter special repr method, but we use the same
naming convention. | pandas/core/generic.py | _repr_data_resource_ | kapilepatel/pandas | python | def _repr_data_resource_(self):
'\n Not a real Jupyter special repr method, but we use the same\n naming convention.\n '
if config.get_option('display.html.table_schema'):
data = self.head(config.get_option('display.max_rows'))
payload = json.loads(data.to_json(orient='table... |
def to_json(self, path_or_buf=None, orient=None, date_format=None, double_precision=10, force_ascii=True, date_unit='ms', default_handler=None, lines=False, compression='infer', index=True):
'\n Convert the object to a JSON string.\n\n Note NaN\'s and None will be converted to null and datetime object... | -6,005,430,837,243,634,000 | Convert the object to a JSON string.
Note NaN's and None will be converted to null and datetime objects
will be converted to UNIX timestamps.
Parameters
----------
path_or_buf : string or file handle, optional
File path or object. If not specified, the result is returned as
a string.
orient : string
Indic... | pandas/core/generic.py | to_json | kapilepatel/pandas | python | def to_json(self, path_or_buf=None, orient=None, date_format=None, double_precision=10, force_ascii=True, date_unit='ms', default_handler=None, lines=False, compression='infer', index=True):
'\n Convert the object to a JSON string.\n\n Note NaN\'s and None will be converted to null and datetime object... |
def to_hdf(self, path_or_buf, key, **kwargs):
"\n Write the contained data to an HDF5 file using HDFStore.\n\n Hierarchical Data Format (HDF) is self-describing, allowing an\n application to interpret the structure and contents of a file with\n no outside information. One HDF file can ho... | 7,546,449,388,981,569,000 | Write the contained data to an HDF5 file using HDFStore.
Hierarchical Data Format (HDF) is self-describing, allowing an
application to interpret the structure and contents of a file with
no outside information. One HDF file can hold a mix of related objects
which can be accessed as a group or as individual objects.
I... | pandas/core/generic.py | to_hdf | kapilepatel/pandas | python | def to_hdf(self, path_or_buf, key, **kwargs):
"\n Write the contained data to an HDF5 file using HDFStore.\n\n Hierarchical Data Format (HDF) is self-describing, allowing an\n application to interpret the structure and contents of a file with\n no outside information. One HDF file can ho... |
def to_msgpack(self, path_or_buf=None, encoding='utf-8', **kwargs):
'\n Serialize object to input file path using msgpack format.\n\n THIS IS AN EXPERIMENTAL LIBRARY and the storage format\n may not be stable until a future release.\n\n Parameters\n ----------\n path : stri... | 6,332,235,171,785,933,000 | Serialize object to input file path using msgpack format.
THIS IS AN EXPERIMENTAL LIBRARY and the storage format
may not be stable until a future release.
Parameters
----------
path : string File path, buffer-like, or None
if None, return generated string
append : bool whether to append to an existing msgpack
... | pandas/core/generic.py | to_msgpack | kapilepatel/pandas | python | def to_msgpack(self, path_or_buf=None, encoding='utf-8', **kwargs):
'\n Serialize object to input file path using msgpack format.\n\n THIS IS AN EXPERIMENTAL LIBRARY and the storage format\n may not be stable until a future release.\n\n Parameters\n ----------\n path : stri... |
def to_sql(self, name, con, schema=None, if_exists='fail', index=True, index_label=None, chunksize=None, dtype=None, method=None):
'\n Write records stored in a DataFrame to a SQL database.\n\n Databases supported by SQLAlchemy [1]_ are supported. Tables can be\n newly created, appended to, or ... | 5,548,303,788,474,474,000 | Write records stored in a DataFrame to a SQL database.
Databases supported by SQLAlchemy [1]_ are supported. Tables can be
newly created, appended to, or overwritten.
Parameters
----------
name : string
Name of SQL table.
con : sqlalchemy.engine.Engine or sqlite3.Connection
Using SQLAlchemy makes it possible ... | pandas/core/generic.py | to_sql | kapilepatel/pandas | python | def to_sql(self, name, con, schema=None, if_exists='fail', index=True, index_label=None, chunksize=None, dtype=None, method=None):
'\n Write records stored in a DataFrame to a SQL database.\n\n Databases supported by SQLAlchemy [1]_ are supported. Tables can be\n newly created, appended to, or ... |
def to_pickle(self, path, compression='infer', protocol=pkl.HIGHEST_PROTOCOL):
'\n Pickle (serialize) object to file.\n\n Parameters\n ----------\n path : str\n File path where the pickled object will be stored.\n compression : {\'infer\', \'gzip\', \'bz2\', \'zip\', \'... | 2,650,534,755,069,774,000 | Pickle (serialize) object to file.
Parameters
----------
path : str
File path where the pickled object will be stored.
compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None}, default 'infer'
A string representing the compression to use in the output file. By
default, infers from the file extensi... | pandas/core/generic.py | to_pickle | kapilepatel/pandas | python | def to_pickle(self, path, compression='infer', protocol=pkl.HIGHEST_PROTOCOL):
'\n Pickle (serialize) object to file.\n\n Parameters\n ----------\n path : str\n File path where the pickled object will be stored.\n compression : {\'infer\', \'gzip\', \'bz2\', \'zip\', \'... |
def to_clipboard(self, excel=True, sep=None, **kwargs):
"\n Copy object to the system clipboard.\n\n Write a text representation of object to the system clipboard.\n This can be pasted into Excel, for example.\n\n Parameters\n ----------\n excel : bool, default True\n ... | -5,960,258,345,454,710,000 | Copy object to the system clipboard.
Write a text representation of object to the system clipboard.
This can be pasted into Excel, for example.
Parameters
----------
excel : bool, default True
- True, use the provided separator, writing in a csv format for
allowing easy pasting into excel.
- False, writ... | pandas/core/generic.py | to_clipboard | kapilepatel/pandas | python | def to_clipboard(self, excel=True, sep=None, **kwargs):
"\n Copy object to the system clipboard.\n\n Write a text representation of object to the system clipboard.\n This can be pasted into Excel, for example.\n\n Parameters\n ----------\n excel : bool, default True\n ... |
def to_xarray(self):
"\n Return an xarray object from the pandas object.\n\n Returns\n -------\n xarray.DataArray or xarray.Dataset\n Data in the pandas structure converted to Dataset if the object is\n a DataFrame, or a DataArray if the object is a Series.\n\n ... | -5,156,739,364,999,233,000 | Return an xarray object from the pandas object.
Returns
-------
xarray.DataArray or xarray.Dataset
Data in the pandas structure converted to Dataset if the object is
a DataFrame, or a DataArray if the object is a Series.
See Also
--------
DataFrame.to_hdf : Write DataFrame to an HDF5 file.
DataFrame.to_parque... | pandas/core/generic.py | to_xarray | kapilepatel/pandas | python | def to_xarray(self):
"\n Return an xarray object from the pandas object.\n\n Returns\n -------\n xarray.DataArray or xarray.Dataset\n Data in the pandas structure converted to Dataset if the object is\n a DataFrame, or a DataArray if the object is a Series.\n\n ... |
def to_latex(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, bold_rows=False, column_format=None, longtable=None, escape=None, encoding=None, decimal='.', multicolumn=None, multicolumn_format=None, multirow=None):
... | 7,407,435,962,317,687,000 | Render an object to a LaTeX tabular environment table.
Render an object to a tabular environment table. You can splice
this into a LaTeX document. Requires \usepackage{booktabs}.
.. versionchanged:: 0.20.2
Added to Series
Parameters
----------
buf : file descriptor or None
Buffer to write to. If None, the out... | pandas/core/generic.py | to_latex | kapilepatel/pandas | python | def to_latex(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, bold_rows=False, column_format=None, longtable=None, escape=None, encoding=None, decimal='.', multicolumn=None, multicolumn_format=None, multirow=None):
... |
def to_csv(self, path_or_buf=None, sep=',', na_rep='', float_format=None, columns=None, header=True, index=True, index_label=None, mode='w', encoding=None, compression='infer', quoting=None, quotechar='"', line_terminator=None, chunksize=None, tupleize_cols=None, date_format=None, doublequote=True, escapechar=None, dec... | 3,406,690,401,346,995,000 | Write object to a comma-separated values (csv) file.
.. versionchanged:: 0.24.0
The order of arguments for Series was changed.
Parameters
----------
path_or_buf : str or file handle, default None
File path or object, if None is provided the result is returned as
a string.
.. versionchanged:: 0.24.0
... | pandas/core/generic.py | to_csv | kapilepatel/pandas | python | def to_csv(self, path_or_buf=None, sep=',', na_rep=, float_format=None, columns=None, header=True, index=True, index_label=None, mode='w', encoding=None, compression='infer', quoting=None, quotechar='"', line_terminator=None, chunksize=None, tupleize_cols=None, date_format=None, doublequote=True, escapechar=None, decim... |
@classmethod
def _create_indexer(cls, name, indexer):
'Create an indexer like _name in the class.'
if (getattr(cls, name, None) is None):
_indexer = functools.partial(indexer, name)
setattr(cls, name, property(_indexer, doc=indexer.__doc__)) | -3,187,923,885,487,062,500 | Create an indexer like _name in the class. | pandas/core/generic.py | _create_indexer | kapilepatel/pandas | python | @classmethod
def _create_indexer(cls, name, indexer):
if (getattr(cls, name, None) is None):
_indexer = functools.partial(indexer, name)
setattr(cls, name, property(_indexer, doc=indexer.__doc__)) |
def get(self, key, default=None):
'\n Get item from object for given key (DataFrame column, Panel slice,\n etc.). Returns default value if not found.\n\n Parameters\n ----------\n key : object\n\n Returns\n -------\n value : same type as items contained in obj... | 7,196,264,157,167,940,000 | Get item from object for given key (DataFrame column, Panel slice,
etc.). Returns default value if not found.
Parameters
----------
key : object
Returns
-------
value : same type as items contained in object | pandas/core/generic.py | get | kapilepatel/pandas | python | def get(self, key, default=None):
'\n Get item from object for given key (DataFrame column, Panel slice,\n etc.). Returns default value if not found.\n\n Parameters\n ----------\n key : object\n\n Returns\n -------\n value : same type as items contained in obj... |
def _get_item_cache(self, item):
'Return the cached item, item represents a label indexer.'
cache = self._item_cache
res = cache.get(item)
if (res is None):
values = self._data.get(item)
res = self._box_item_values(item, values)
cache[item] = res
res._set_as_cached(item, ... | -6,555,597,053,920,934,000 | Return the cached item, item represents a label indexer. | pandas/core/generic.py | _get_item_cache | kapilepatel/pandas | python | def _get_item_cache(self, item):
cache = self._item_cache
res = cache.get(item)
if (res is None):
values = self._data.get(item)
res = self._box_item_values(item, values)
cache[item] = res
res._set_as_cached(item, self)
res._is_copy = self._is_copy
return res |
def _set_as_cached(self, item, cacher):
'Set the _cacher attribute on the calling object with a weakref to\n cacher.\n '
self._cacher = (item, weakref.ref(cacher)) | -5,891,535,431,011,866,000 | Set the _cacher attribute on the calling object with a weakref to
cacher. | pandas/core/generic.py | _set_as_cached | kapilepatel/pandas | python | def _set_as_cached(self, item, cacher):
'Set the _cacher attribute on the calling object with a weakref to\n cacher.\n '
self._cacher = (item, weakref.ref(cacher)) |
def _reset_cacher(self):
'Reset the cacher.'
if hasattr(self, '_cacher'):
del self._cacher | -5,268,877,552,582,349,000 | Reset the cacher. | pandas/core/generic.py | _reset_cacher | kapilepatel/pandas | python | def _reset_cacher(self):
if hasattr(self, '_cacher'):
del self._cacher |
def _iget_item_cache(self, item):
'Return the cached item, item represents a positional indexer.'
ax = self._info_axis
if ax.is_unique:
lower = self._get_item_cache(ax[item])
else:
lower = self._take(item, axis=self._info_axis_number)
return lower | -1,188,085,687,366,115,600 | Return the cached item, item represents a positional indexer. | pandas/core/generic.py | _iget_item_cache | kapilepatel/pandas | python | def _iget_item_cache(self, item):
ax = self._info_axis
if ax.is_unique:
lower = self._get_item_cache(ax[item])
else:
lower = self._take(item, axis=self._info_axis_number)
return lower |
def _maybe_cache_changed(self, item, value):
'The object has called back to us saying maybe it has changed.\n '
self._data.set(item, value) | -3,534,873,743,098,020,000 | The object has called back to us saying maybe it has changed. | pandas/core/generic.py | _maybe_cache_changed | kapilepatel/pandas | python | def _maybe_cache_changed(self, item, value):
'\n '
self._data.set(item, value) |
@property
def _is_cached(self):
'Return boolean indicating if self is cached or not.'
return (getattr(self, '_cacher', None) is not None) | -4,355,322,062,463,915,000 | Return boolean indicating if self is cached or not. | pandas/core/generic.py | _is_cached | kapilepatel/pandas | python | @property
def _is_cached(self):
return (getattr(self, '_cacher', None) is not None) |
def _get_cacher(self):
'return my cacher or None'
cacher = getattr(self, '_cacher', None)
if (cacher is not None):
cacher = cacher[1]()
return cacher | 4,695,654,946,970,992,000 | return my cacher or None | pandas/core/generic.py | _get_cacher | kapilepatel/pandas | python | def _get_cacher(self):
cacher = getattr(self, '_cacher', None)
if (cacher is not None):
cacher = cacher[1]()
return cacher |
@property
def _is_view(self):
'Return boolean indicating if self is view of another array '
return self._data.is_view | -2,310,442,685,064,172,000 | Return boolean indicating if self is view of another array | pandas/core/generic.py | _is_view | kapilepatel/pandas | python | @property
def _is_view(self):
' '
return self._data.is_view |
def _maybe_update_cacher(self, clear=False, verify_is_copy=True):
'\n See if we need to update our parent cacher if clear, then clear our\n cache.\n\n Parameters\n ----------\n clear : boolean, default False\n clear the item cache\n verify_is_copy : boolean, defa... | -3,125,249,544,881,261,600 | See if we need to update our parent cacher if clear, then clear our
cache.
Parameters
----------
clear : boolean, default False
clear the item cache
verify_is_copy : boolean, default True
provide is_copy checks | pandas/core/generic.py | _maybe_update_cacher | kapilepatel/pandas | python | def _maybe_update_cacher(self, clear=False, verify_is_copy=True):
'\n See if we need to update our parent cacher if clear, then clear our\n cache.\n\n Parameters\n ----------\n clear : boolean, default False\n clear the item cache\n verify_is_copy : boolean, defa... |
def _slice(self, slobj, axis=0, kind=None):
'\n Construct a slice of this container.\n\n kind parameter is maintained for compatibility with Series slicing.\n '
axis = self._get_block_manager_axis(axis)
result = self._constructor(self._data.get_slice(slobj, axis=axis))
result = resu... | -6,803,673,270,064,336,000 | Construct a slice of this container.
kind parameter is maintained for compatibility with Series slicing. | pandas/core/generic.py | _slice | kapilepatel/pandas | python | def _slice(self, slobj, axis=0, kind=None):
'\n Construct a slice of this container.\n\n kind parameter is maintained for compatibility with Series slicing.\n '
axis = self._get_block_manager_axis(axis)
result = self._constructor(self._data.get_slice(slobj, axis=axis))
result = resu... |
def _check_is_chained_assignment_possible(self):
'\n Check if we are a view, have a cacher, and are of mixed type.\n If so, then force a setitem_copy check.\n\n Should be called just near setting a value\n\n Will return a boolean if it we are a view and are cached, but a\n single-... | 7,285,224,792,968,785,000 | Check if we are a view, have a cacher, and are of mixed type.
If so, then force a setitem_copy check.
Should be called just near setting a value
Will return a boolean if it we are a view and are cached, but a
single-dtype meaning that the cacher should be updated following
setting. | pandas/core/generic.py | _check_is_chained_assignment_possible | kapilepatel/pandas | python | def _check_is_chained_assignment_possible(self):
'\n Check if we are a view, have a cacher, and are of mixed type.\n If so, then force a setitem_copy check.\n\n Should be called just near setting a value\n\n Will return a boolean if it we are a view and are cached, but a\n single-... |
def _check_setitem_copy(self, stacklevel=4, t='setting', force=False):
"\n\n Parameters\n ----------\n stacklevel : integer, default 4\n the level to show of the stack when the error is output\n t : string, the type of setting error\n force : boolean, default False\n ... | 6,389,951,531,743,159,000 | Parameters
----------
stacklevel : integer, default 4
the level to show of the stack when the error is output
t : string, the type of setting error
force : boolean, default False
if True, then force showing an error
validate if we are doing a settitem on a chained copy.
If you call this function, be sure to set... | pandas/core/generic.py | _check_setitem_copy | kapilepatel/pandas | python | def _check_setitem_copy(self, stacklevel=4, t='setting', force=False):
"\n\n Parameters\n ----------\n stacklevel : integer, default 4\n the level to show of the stack when the error is output\n t : string, the type of setting error\n force : boolean, default False\n ... |
def __delitem__(self, key):
'\n Delete item\n '
deleted = False
maybe_shortcut = False
if (hasattr(self, 'columns') and isinstance(self.columns, MultiIndex)):
try:
maybe_shortcut = (key not in self.columns._engine)
except TypeError:
pass
if maybe... | 1,421,860,525,802,677,000 | Delete item | pandas/core/generic.py | __delitem__ | kapilepatel/pandas | python | def __delitem__(self, key):
'\n \n '
deleted = False
maybe_shortcut = False
if (hasattr(self, 'columns') and isinstance(self.columns, MultiIndex)):
try:
maybe_shortcut = (key not in self.columns._engine)
except TypeError:
pass
if maybe_shortcut:
... |
def _take(self, indices, axis=0, is_copy=True):
'\n Return the elements in the given *positional* indices along an axis.\n\n This means that we are not indexing according to actual values in\n the index attribute of the object. We are indexing according to the\n actual position of the el... | -1,342,954,698,798,398,500 | Return the elements in the given *positional* indices along an axis.
This means that we are not indexing according to actual values in
the index attribute of the object. We are indexing according to the
actual position of the element in the object.
This is the internal version of ``.take()`` and will contain a wider
... | pandas/core/generic.py | _take | kapilepatel/pandas | python | def _take(self, indices, axis=0, is_copy=True):
'\n Return the elements in the given *positional* indices along an axis.\n\n This means that we are not indexing according to actual values in\n the index attribute of the object. We are indexing according to the\n actual position of the el... |
def take(self, indices, axis=0, convert=None, is_copy=True, **kwargs):
"\n Return the elements in the given *positional* indices along an axis.\n\n This means that we are not indexing according to actual values in\n the index attribute of the object. We are indexing according to the\n ac... | 3,953,250,733,073,923,000 | Return the elements in the given *positional* indices along an axis.
This means that we are not indexing according to actual values in
the index attribute of the object. We are indexing according to the
actual position of the element in the object.
Parameters
----------
indices : array-like
An array of ints indic... | pandas/core/generic.py | take | kapilepatel/pandas | python | def take(self, indices, axis=0, convert=None, is_copy=True, **kwargs):
"\n Return the elements in the given *positional* indices along an axis.\n\n This means that we are not indexing according to actual values in\n the index attribute of the object. We are indexing according to the\n ac... |
def xs(self, key, axis=0, level=None, drop_level=True):
"\n Return cross-section from the Series/DataFrame.\n\n This method takes a `key` argument to select data at a particular\n level of a MultiIndex.\n\n Parameters\n ----------\n key : label or tuple of label\n ... | 699,185,656,904,247,600 | Return cross-section from the Series/DataFrame.
This method takes a `key` argument to select data at a particular
level of a MultiIndex.
Parameters
----------
key : label or tuple of label
Label contained in the index, or partially in a MultiIndex.
axis : {0 or 'index', 1 or 'columns'}, default 0
Axis to retr... | pandas/core/generic.py | xs | kapilepatel/pandas | python | def xs(self, key, axis=0, level=None, drop_level=True):
"\n Return cross-section from the Series/DataFrame.\n\n This method takes a `key` argument to select data at a particular\n level of a MultiIndex.\n\n Parameters\n ----------\n key : label or tuple of label\n ... |
def select(self, crit, axis=0):
'\n Return data corresponding to axis labels matching criteria.\n\n .. deprecated:: 0.21.0\n Use df.loc[df.index.map(crit)] to select via labels\n\n Parameters\n ----------\n crit : function\n To be called on each index (label)... | -8,151,492,177,665,365,000 | Return data corresponding to axis labels matching criteria.
.. deprecated:: 0.21.0
Use df.loc[df.index.map(crit)] to select via labels
Parameters
----------
crit : function
To be called on each index (label). Should return True or False
axis : int
Returns
-------
selection : same type as caller | pandas/core/generic.py | select | kapilepatel/pandas | python | def select(self, crit, axis=0):
'\n Return data corresponding to axis labels matching criteria.\n\n .. deprecated:: 0.21.0\n Use df.loc[df.index.map(crit)] to select via labels\n\n Parameters\n ----------\n crit : function\n To be called on each index (label)... |
def reindex_like(self, other, method=None, copy=True, limit=None, tolerance=None):
"\n Return an object with matching indices as other object.\n\n Conform the object to the same index on all axes. Optional\n filling logic, placing NaN in locations having no value\n in the previous index.... | -2,882,357,771,167,848,400 | Return an object with matching indices as other object.
Conform the object to the same index on all axes. Optional
filling logic, placing NaN in locations having no value
in the previous index. A new object is produced unless the
new index is equivalent to the current one and copy=False.
Parameters
----------
other :... | pandas/core/generic.py | reindex_like | kapilepatel/pandas | python | def reindex_like(self, other, method=None, copy=True, limit=None, tolerance=None):
"\n Return an object with matching indices as other object.\n\n Conform the object to the same index on all axes. Optional\n filling logic, placing NaN in locations having no value\n in the previous index.... |
def _drop_axis(self, labels, axis, level=None, errors='raise'):
"\n Drop labels from specified axis. Used in the ``drop`` method\n internally.\n\n Parameters\n ----------\n labels : single label or list-like\n axis : int or axis name\n level : int or level name, defa... | 8,765,291,950,766,307,000 | Drop labels from specified axis. Used in the ``drop`` method
internally.
Parameters
----------
labels : single label or list-like
axis : int or axis name
level : int or level name, default None
For MultiIndex
errors : {'ignore', 'raise'}, default 'raise'
If 'ignore', suppress error and existing labels are drop... | pandas/core/generic.py | _drop_axis | kapilepatel/pandas | python | def _drop_axis(self, labels, axis, level=None, errors='raise'):
"\n Drop labels from specified axis. Used in the ``drop`` method\n internally.\n\n Parameters\n ----------\n labels : single label or list-like\n axis : int or axis name\n level : int or level name, defa... |
def _update_inplace(self, result, verify_is_copy=True):
'\n Replace self internals with result.\n\n Parameters\n ----------\n verify_is_copy : boolean, default True\n provide is_copy checks\n\n '
self._reset_cache()
self._clear_item_cache()
self._data = geta... | 4,356,424,455,077,415,400 | Replace self internals with result.
Parameters
----------
verify_is_copy : boolean, default True
provide is_copy checks | pandas/core/generic.py | _update_inplace | kapilepatel/pandas | python | def _update_inplace(self, result, verify_is_copy=True):
'\n Replace self internals with result.\n\n Parameters\n ----------\n verify_is_copy : boolean, default True\n provide is_copy checks\n\n '
self._reset_cache()
self._clear_item_cache()
self._data = geta... |
def add_prefix(self, prefix):
"\n Prefix labels with string `prefix`.\n\n For Series, the row labels are prefixed.\n For DataFrame, the column labels are prefixed.\n\n Parameters\n ----------\n prefix : str\n The string to add before each label.\n\n Return... | -2,298,415,598,138,723,300 | Prefix labels with string `prefix`.
For Series, the row labels are prefixed.
For DataFrame, the column labels are prefixed.
Parameters
----------
prefix : str
The string to add before each label.
Returns
-------
Series or DataFrame
New Series or DataFrame with updated labels.
See Also
--------
Series.add_su... | pandas/core/generic.py | add_prefix | kapilepatel/pandas | python | def add_prefix(self, prefix):
"\n Prefix labels with string `prefix`.\n\n For Series, the row labels are prefixed.\n For DataFrame, the column labels are prefixed.\n\n Parameters\n ----------\n prefix : str\n The string to add before each label.\n\n Return... |
def add_suffix(self, suffix):
"\n Suffix labels with string `suffix`.\n\n For Series, the row labels are suffixed.\n For DataFrame, the column labels are suffixed.\n\n Parameters\n ----------\n suffix : str\n The string to add after each label.\n\n Returns... | 6,699,270,932,651,102,000 | Suffix labels with string `suffix`.
For Series, the row labels are suffixed.
For DataFrame, the column labels are suffixed.
Parameters
----------
suffix : str
The string to add after each label.
Returns
-------
Series or DataFrame
New Series or DataFrame with updated labels.
See Also
--------
Series.add_pre... | pandas/core/generic.py | add_suffix | kapilepatel/pandas | python | def add_suffix(self, suffix):
"\n Suffix labels with string `suffix`.\n\n For Series, the row labels are suffixed.\n For DataFrame, the column labels are suffixed.\n\n Parameters\n ----------\n suffix : str\n The string to add after each label.\n\n Returns... |
def sort_values(self, by=None, axis=0, ascending=True, inplace=False, kind='quicksort', na_position='last'):
"\n Sort by the values along either axis.\n\n Parameters\n ----------%(optional_by)s\n axis : %(axes_single_arg)s, default 0\n Axis to be sorted.\n ascending : ... | -6,910,440,778,229,990,000 | Sort by the values along either axis.
Parameters
----------%(optional_by)s
axis : %(axes_single_arg)s, default 0
Axis to be sorted.
ascending : bool or list of bool, default True
Sort ascending vs. descending. Specify list for multiple sort
orders. If this is a list of bools, must match the length of
... | pandas/core/generic.py | sort_values | kapilepatel/pandas | python | def sort_values(self, by=None, axis=0, ascending=True, inplace=False, kind='quicksort', na_position='last'):
"\n Sort by the values along either axis.\n\n Parameters\n ----------%(optional_by)s\n axis : %(axes_single_arg)s, default 0\n Axis to be sorted.\n ascending : ... |
def sort_index(self, axis=0, level=None, ascending=True, inplace=False, kind='quicksort', na_position='last', sort_remaining=True):
"\n Sort object by labels (along an axis).\n\n Parameters\n ----------\n axis : {0 or 'index', 1 or 'columns'}, default 0\n The axis along which ... | 4,111,235,535,888,698,000 | Sort object by labels (along an axis).
Parameters
----------
axis : {0 or 'index', 1 or 'columns'}, default 0
The axis along which to sort. The value 0 identifies the rows,
and 1 identifies the columns.
level : int or level name or list of ints or list of level names
If not None, sort on values in specifi... | pandas/core/generic.py | sort_index | kapilepatel/pandas | python | def sort_index(self, axis=0, level=None, ascending=True, inplace=False, kind='quicksort', na_position='last', sort_remaining=True):
"\n Sort object by labels (along an axis).\n\n Parameters\n ----------\n axis : {0 or 'index', 1 or 'columns'}, default 0\n The axis along which ... |
def reindex(self, *args, **kwargs):
'\n Conform %(klass)s to new index with optional filling logic, placing\n NA/NaN in locations having no value in the previous index. A new object\n is produced unless the new index is equivalent to the current one and\n ``copy=False``.\n\n Param... | 34,584,110,546,635,700 | Conform %(klass)s to new index with optional filling logic, placing
NA/NaN in locations having no value in the previous index. A new object
is produced unless the new index is equivalent to the current one and
``copy=False``.
Parameters
----------
%(optional_labels)s
%(axes)s : array-like, optional
New labels / in... | pandas/core/generic.py | reindex | kapilepatel/pandas | python | def reindex(self, *args, **kwargs):
'\n Conform %(klass)s to new index with optional filling logic, placing\n NA/NaN in locations having no value in the previous index. A new object\n is produced unless the new index is equivalent to the current one and\n ``copy=False``.\n\n Param... |
def _reindex_axes(self, axes, level, limit, tolerance, method, fill_value, copy):
'Perform the reindex for all the axes.'
obj = self
for a in self._AXIS_ORDERS:
labels = axes[a]
if (labels is None):
continue
ax = self._get_axis(a)
(new_index, indexer) = ax.reindex... | 4,721,573,882,537,585,000 | Perform the reindex for all the axes. | pandas/core/generic.py | _reindex_axes | kapilepatel/pandas | python | def _reindex_axes(self, axes, level, limit, tolerance, method, fill_value, copy):
obj = self
for a in self._AXIS_ORDERS:
labels = axes[a]
if (labels is None):
continue
ax = self._get_axis(a)
(new_index, indexer) = ax.reindex(labels, level=level, limit=limit, tole... |
def _needs_reindex_multi(self, axes, method, level):
'Check if we do need a multi reindex.'
return ((com.count_not_none(*axes.values()) == self._AXIS_LEN) and (method is None) and (level is None) and (not self._is_mixed_type)) | 2,577,472,411,366,709,000 | Check if we do need a multi reindex. | pandas/core/generic.py | _needs_reindex_multi | kapilepatel/pandas | python | def _needs_reindex_multi(self, axes, method, level):
return ((com.count_not_none(*axes.values()) == self._AXIS_LEN) and (method is None) and (level is None) and (not self._is_mixed_type)) |
def _reindex_with_indexers(self, reindexers, fill_value=None, copy=False, allow_dups=False):
'allow_dups indicates an internal call here '
new_data = self._data
for axis in sorted(reindexers.keys()):
(index, indexer) = reindexers[axis]
baxis = self._get_block_manager_axis(axis)
if (i... | 6,166,168,766,132,388,000 | allow_dups indicates an internal call here | pandas/core/generic.py | _reindex_with_indexers | kapilepatel/pandas | python | def _reindex_with_indexers(self, reindexers, fill_value=None, copy=False, allow_dups=False):
' '
new_data = self._data
for axis in sorted(reindexers.keys()):
(index, indexer) = reindexers[axis]
baxis = self._get_block_manager_axis(axis)
if (index is None):
continue
... |
def filter(self, items=None, like=None, regex=None, axis=None):
'\n Subset rows or columns of dataframe according to labels in\n the specified index.\n\n Note that this routine does not filter a dataframe on its\n contents. The filter is applied to the labels of the index.\n\n Par... | -4,145,134,183,278,041,000 | Subset rows or columns of dataframe according to labels in
the specified index.
Note that this routine does not filter a dataframe on its
contents. The filter is applied to the labels of the index.
Parameters
----------
items : list-like
List of axis to restrict to (must not all be present).
like : string
Kee... | pandas/core/generic.py | filter | kapilepatel/pandas | python | def filter(self, items=None, like=None, regex=None, axis=None):
'\n Subset rows or columns of dataframe according to labels in\n the specified index.\n\n Note that this routine does not filter a dataframe on its\n contents. The filter is applied to the labels of the index.\n\n Par... |
def head(self, n=5):
"\n Return the first `n` rows.\n\n This function returns the first `n` rows for the object based\n on position. It is useful for quickly testing if your object\n has the right type of data in it.\n\n Parameters\n ----------\n n : int, default 5\n... | 2,804,147,561,031,767,000 | Return the first `n` rows.
This function returns the first `n` rows for the object based
on position. It is useful for quickly testing if your object
has the right type of data in it.
Parameters
----------
n : int, default 5
Number of rows to select.
Returns
-------
obj_head : same type as caller
The first `... | pandas/core/generic.py | head | kapilepatel/pandas | python | def head(self, n=5):
"\n Return the first `n` rows.\n\n This function returns the first `n` rows for the object based\n on position. It is useful for quickly testing if your object\n has the right type of data in it.\n\n Parameters\n ----------\n n : int, default 5\n... |
def tail(self, n=5):
"\n Return the last `n` rows.\n\n This function returns last `n` rows from the object based on\n position. It is useful for quickly verifying data, for example,\n after sorting or appending rows.\n\n Parameters\n ----------\n n : int, default 5\n... | 8,234,679,230,865,114,000 | Return the last `n` rows.
This function returns last `n` rows from the object based on
position. It is useful for quickly verifying data, for example,
after sorting or appending rows.
Parameters
----------
n : int, default 5
Number of rows to select.
Returns
-------
type of caller
The last `n` rows of the ca... | pandas/core/generic.py | tail | kapilepatel/pandas | python | def tail(self, n=5):
"\n Return the last `n` rows.\n\n This function returns last `n` rows from the object based on\n position. It is useful for quickly verifying data, for example,\n after sorting or appending rows.\n\n Parameters\n ----------\n n : int, default 5\n... |
def sample(self, n=None, frac=None, replace=False, weights=None, random_state=None, axis=None):
"\n Return a random sample of items from an axis of object.\n\n You can use `random_state` for reproducibility.\n\n Parameters\n ----------\n n : int, optional\n Number of it... | 2,898,805,098,321,995,300 | Return a random sample of items from an axis of object.
You can use `random_state` for reproducibility.
Parameters
----------
n : int, optional
Number of items from axis to return. Cannot be used with `frac`.
Default = 1 if `frac` = None.
frac : float, optional
Fraction of axis items to return. Cannot be ... | pandas/core/generic.py | sample | kapilepatel/pandas | python | def sample(self, n=None, frac=None, replace=False, weights=None, random_state=None, axis=None):
"\n Return a random sample of items from an axis of object.\n\n You can use `random_state` for reproducibility.\n\n Parameters\n ----------\n n : int, optional\n Number of it... |
def __finalize__(self, other, method=None, **kwargs):
'\n Propagate metadata from other to self.\n\n Parameters\n ----------\n other : the object from which to get the attributes that we are going\n to propagate\n method : optional, a passed method name ; possibly to ta... | 3,008,792,019,042,377,000 | Propagate metadata from other to self.
Parameters
----------
other : the object from which to get the attributes that we are going
to propagate
method : optional, a passed method name ; possibly to take different
types of propagation actions based on this | pandas/core/generic.py | __finalize__ | kapilepatel/pandas | python | def __finalize__(self, other, method=None, **kwargs):
'\n Propagate metadata from other to self.\n\n Parameters\n ----------\n other : the object from which to get the attributes that we are going\n to propagate\n method : optional, a passed method name ; possibly to ta... |
def __getattr__(self, name):
'After regular attribute access, try looking up the name\n This allows simpler access to columns for interactive use.\n '
if ((name in self._internal_names_set) or (name in self._metadata) or (name in self._accessors)):
return object.__getattribute__(self, name... | 1,779,493,466,214,910,700 | After regular attribute access, try looking up the name
This allows simpler access to columns for interactive use. | pandas/core/generic.py | __getattr__ | kapilepatel/pandas | python | def __getattr__(self, name):
'After regular attribute access, try looking up the name\n This allows simpler access to columns for interactive use.\n '
if ((name in self._internal_names_set) or (name in self._metadata) or (name in self._accessors)):
return object.__getattribute__(self, name... |
def __setattr__(self, name, value):
'After regular attribute access, try setting the name\n This allows simpler access to columns for interactive use.\n '
try:
object.__getattribute__(self, name)
return object.__setattr__(self, name, value)
except AttributeError:
pass
... | -2,991,854,804,421,538,000 | After regular attribute access, try setting the name
This allows simpler access to columns for interactive use. | pandas/core/generic.py | __setattr__ | kapilepatel/pandas | python | def __setattr__(self, name, value):
'After regular attribute access, try setting the name\n This allows simpler access to columns for interactive use.\n '
try:
object.__getattribute__(self, name)
return object.__setattr__(self, name, value)
except AttributeError:
pass
... |
def _dir_additions(self):
" add the string-like attributes from the info_axis.\n If info_axis is a MultiIndex, it's first level values are used.\n "
additions = {c for c in self._info_axis.unique(level=0)[:100] if (isinstance(c, string_types) and isidentifier(c))}
return super(NDFrame, self)._... | 3,693,849,406,929,341,000 | add the string-like attributes from the info_axis.
If info_axis is a MultiIndex, it's first level values are used. | pandas/core/generic.py | _dir_additions | kapilepatel/pandas | python | def _dir_additions(self):
" add the string-like attributes from the info_axis.\n If info_axis is a MultiIndex, it's first level values are used.\n "
additions = {c for c in self._info_axis.unique(level=0)[:100] if (isinstance(c, string_types) and isidentifier(c))}
return super(NDFrame, self)._... |
def _protect_consolidate(self, f):
'Consolidate _data -- if the blocks have changed, then clear the\n cache\n '
blocks_before = len(self._data.blocks)
result = f()
if (len(self._data.blocks) != blocks_before):
self._clear_item_cache()
return result | -8,495,753,483,392,909,000 | Consolidate _data -- if the blocks have changed, then clear the
cache | pandas/core/generic.py | _protect_consolidate | kapilepatel/pandas | python | def _protect_consolidate(self, f):
'Consolidate _data -- if the blocks have changed, then clear the\n cache\n '
blocks_before = len(self._data.blocks)
result = f()
if (len(self._data.blocks) != blocks_before):
self._clear_item_cache()
return result |
def _consolidate_inplace(self):
'Consolidate data in place and return None'
def f():
self._data = self._data.consolidate()
self._protect_consolidate(f) | -4,123,879,335,490,513,000 | Consolidate data in place and return None | pandas/core/generic.py | _consolidate_inplace | kapilepatel/pandas | python | def _consolidate_inplace(self):
def f():
self._data = self._data.consolidate()
self._protect_consolidate(f) |
def _consolidate(self, inplace=False):
'\n Compute NDFrame with "consolidated" internals (data of each dtype\n grouped together in a single ndarray).\n\n Parameters\n ----------\n inplace : boolean, default False\n If False return new object, otherwise modify existing o... | 5,301,103,510,948,307,000 | Compute NDFrame with "consolidated" internals (data of each dtype
grouped together in a single ndarray).
Parameters
----------
inplace : boolean, default False
If False return new object, otherwise modify existing object
Returns
-------
consolidated : same type as caller | pandas/core/generic.py | _consolidate | kapilepatel/pandas | python | def _consolidate(self, inplace=False):
'\n Compute NDFrame with "consolidated" internals (data of each dtype\n grouped together in a single ndarray).\n\n Parameters\n ----------\n inplace : boolean, default False\n If False return new object, otherwise modify existing o... |
def _check_inplace_setting(self, value):
' check whether we allow in-place setting with this type of value '
if self._is_mixed_type:
if (not self._is_numeric_mixed_type):
try:
if np.isnan(value):
return True
except Exception:
pa... | 7,890,420,370,806,967,000 | check whether we allow in-place setting with this type of value | pandas/core/generic.py | _check_inplace_setting | kapilepatel/pandas | python | def _check_inplace_setting(self, value):
' '
if self._is_mixed_type:
if (not self._is_numeric_mixed_type):
try:
if np.isnan(value):
return True
except Exception:
pass
raise TypeError('Cannot do inplace boolean setti... |
def as_matrix(self, columns=None):
"\n Convert the frame to its Numpy-array representation.\n\n .. deprecated:: 0.23.0\n Use :meth:`DataFrame.values` instead.\n\n Parameters\n ----------\n columns : list, optional, default:None\n If None, return all columns, ... | 5,670,880,082,385,726,000 | Convert the frame to its Numpy-array representation.
.. deprecated:: 0.23.0
Use :meth:`DataFrame.values` instead.
Parameters
----------
columns : list, optional, default:None
If None, return all columns, otherwise, returns specified columns.
Returns
-------
values : ndarray
If the caller is heterogeneous... | pandas/core/generic.py | as_matrix | kapilepatel/pandas | python | def as_matrix(self, columns=None):
"\n Convert the frame to its Numpy-array representation.\n\n .. deprecated:: 0.23.0\n Use :meth:`DataFrame.values` instead.\n\n Parameters\n ----------\n columns : list, optional, default:None\n If None, return all columns, ... |
@property
def values(self):
"\n Return a Numpy representation of the DataFrame.\n\n .. warning::\n\n We recommend using :meth:`DataFrame.to_numpy` instead.\n\n Only the values in the DataFrame will be returned, the axes labels\n will be removed.\n\n Returns\n ----... | 8,607,021,873,946,367,000 | Return a Numpy representation of the DataFrame.
.. warning::
We recommend using :meth:`DataFrame.to_numpy` instead.
Only the values in the DataFrame will be returned, the axes labels
will be removed.
Returns
-------
numpy.ndarray
The values of the DataFrame.
See Also
--------
DataFrame.to_numpy : Recommende... | pandas/core/generic.py | values | kapilepatel/pandas | python | @property
def values(self):
"\n Return a Numpy representation of the DataFrame.\n\n .. warning::\n\n We recommend using :meth:`DataFrame.to_numpy` instead.\n\n Only the values in the DataFrame will be returned, the axes labels\n will be removed.\n\n Returns\n ----... |
@property
def _values(self):
'internal implementation'
return self.values | -4,509,188,480,570,620,400 | internal implementation | pandas/core/generic.py | _values | kapilepatel/pandas | python | @property
def _values(self):
return self.values |
def get_values(self):
'\n Return an ndarray after converting sparse values to dense.\n\n This is the same as ``.values`` for non-sparse data. For sparse\n data contained in a `SparseArray`, the data are first\n converted to a dense representation.\n\n Returns\n -------\n ... | 4,427,257,201,389,257,000 | Return an ndarray after converting sparse values to dense.
This is the same as ``.values`` for non-sparse data. For sparse
data contained in a `SparseArray`, the data are first
converted to a dense representation.
Returns
-------
numpy.ndarray
Numpy representation of DataFrame.
See Also
--------
values : Numpy r... | pandas/core/generic.py | get_values | kapilepatel/pandas | python | def get_values(self):
'\n Return an ndarray after converting sparse values to dense.\n\n This is the same as ``.values`` for non-sparse data. For sparse\n data contained in a `SparseArray`, the data are first\n converted to a dense representation.\n\n Returns\n -------\n ... |
def get_dtype_counts(self):
"\n Return counts of unique dtypes in this object.\n\n Returns\n -------\n dtype : Series\n Series with the count of columns with each dtype.\n\n See Also\n --------\n dtypes : Return the dtypes in this object.\n\n Exampl... | 340,209,381,645,793,860 | Return counts of unique dtypes in this object.
Returns
-------
dtype : Series
Series with the count of columns with each dtype.
See Also
--------
dtypes : Return the dtypes in this object.
Examples
--------
>>> a = [['a', 1, 1.0], ['b', 2, 2.0], ['c', 3, 3.0]]
>>> df = pd.DataFrame(a, columns=['str', 'int', 'flo... | pandas/core/generic.py | get_dtype_counts | kapilepatel/pandas | python | def get_dtype_counts(self):
"\n Return counts of unique dtypes in this object.\n\n Returns\n -------\n dtype : Series\n Series with the count of columns with each dtype.\n\n See Also\n --------\n dtypes : Return the dtypes in this object.\n\n Exampl... |
def get_ftype_counts(self):
"\n Return counts of unique ftypes in this object.\n\n .. deprecated:: 0.23.0\n\n This is useful for SparseDataFrame or for DataFrames containing\n sparse arrays.\n\n Returns\n -------\n dtype : Series\n Series with the count of... | 1,105,224,838,373,287,300 | Return counts of unique ftypes in this object.
.. deprecated:: 0.23.0
This is useful for SparseDataFrame or for DataFrames containing
sparse arrays.
Returns
-------
dtype : Series
Series with the count of columns with each type and
sparsity (dense/sparse).
See Also
--------
ftypes : Return ftypes (indicatio... | pandas/core/generic.py | get_ftype_counts | kapilepatel/pandas | python | def get_ftype_counts(self):
"\n Return counts of unique ftypes in this object.\n\n .. deprecated:: 0.23.0\n\n This is useful for SparseDataFrame or for DataFrames containing\n sparse arrays.\n\n Returns\n -------\n dtype : Series\n Series with the count of... |
@property
def dtypes(self):
"\n Return the dtypes in the DataFrame.\n\n This returns a Series with the data type of each column.\n The result's index is the original DataFrame's columns. Columns\n with mixed types are stored with the ``object`` dtype. See\n :ref:`the User Guide <b... | -9,017,179,737,222,990,000 | Return the dtypes in the DataFrame.
This returns a Series with the data type of each column.
The result's index is the original DataFrame's columns. Columns
with mixed types are stored with the ``object`` dtype. See
:ref:`the User Guide <basics.dtypes>` for more.
Returns
-------
pandas.Series
The data type of eac... | pandas/core/generic.py | dtypes | kapilepatel/pandas | python | @property
def dtypes(self):
"\n Return the dtypes in the DataFrame.\n\n This returns a Series with the data type of each column.\n The result's index is the original DataFrame's columns. Columns\n with mixed types are stored with the ``object`` dtype. See\n :ref:`the User Guide <b... |
@property
def ftypes(self):
"\n Return the ftypes (indication of sparse/dense and dtype) in DataFrame.\n\n This returns a Series with the data type of each column.\n The result's index is the original DataFrame's columns. Columns\n with mixed types are stored with the ``object`` dtype. ... | -5,507,165,227,604,726,000 | Return the ftypes (indication of sparse/dense and dtype) in DataFrame.
This returns a Series with the data type of each column.
The result's index is the original DataFrame's columns. Columns
with mixed types are stored with the ``object`` dtype. See
:ref:`the User Guide <basics.dtypes>` for more.
Returns
-------
pa... | pandas/core/generic.py | ftypes | kapilepatel/pandas | python | @property
def ftypes(self):
"\n Return the ftypes (indication of sparse/dense and dtype) in DataFrame.\n\n This returns a Series with the data type of each column.\n The result's index is the original DataFrame's columns. Columns\n with mixed types are stored with the ``object`` dtype. ... |
def as_blocks(self, copy=True):
'\n Convert the frame to a dict of dtype -> Constructor Types that each has\n a homogeneous dtype.\n\n .. deprecated:: 0.21.0\n\n NOTE: the dtypes of the blocks WILL BE PRESERVED HERE (unlike in\n as_matrix)\n\n Parameters\n ----... | -1,815,616,619,229,013,200 | Convert the frame to a dict of dtype -> Constructor Types that each has
a homogeneous dtype.
.. deprecated:: 0.21.0
NOTE: the dtypes of the blocks WILL BE PRESERVED HERE (unlike in
as_matrix)
Parameters
----------
copy : boolean, default True
Returns
-------
values : a dict of dtype -> Constructor Types | pandas/core/generic.py | as_blocks | kapilepatel/pandas | python | def as_blocks(self, copy=True):
'\n Convert the frame to a dict of dtype -> Constructor Types that each has\n a homogeneous dtype.\n\n .. deprecated:: 0.21.0\n\n NOTE: the dtypes of the blocks WILL BE PRESERVED HERE (unlike in\n as_matrix)\n\n Parameters\n ----... |
@property
def blocks(self):
'\n Internal property, property synonym for as_blocks().\n\n .. deprecated:: 0.21.0\n '
return self.as_blocks() | 231,908,323,301,257,660 | Internal property, property synonym for as_blocks().
.. deprecated:: 0.21.0 | pandas/core/generic.py | blocks | kapilepatel/pandas | python | @property
def blocks(self):
'\n Internal property, property synonym for as_blocks().\n\n .. deprecated:: 0.21.0\n '
return self.as_blocks() |
def _to_dict_of_blocks(self, copy=True):
'\n Return a dict of dtype -> Constructor Types that\n each is a homogeneous dtype.\n\n Internal ONLY\n '
return {k: self._constructor(v).__finalize__(self) for (k, v) in self._data.to_dict(copy=copy).items()} | 2,710,795,027,365,615,000 | Return a dict of dtype -> Constructor Types that
each is a homogeneous dtype.
Internal ONLY | pandas/core/generic.py | _to_dict_of_blocks | kapilepatel/pandas | python | def _to_dict_of_blocks(self, copy=True):
'\n Return a dict of dtype -> Constructor Types that\n each is a homogeneous dtype.\n\n Internal ONLY\n '
return {k: self._constructor(v).__finalize__(self) for (k, v) in self._data.to_dict(copy=copy).items()} |
def astype(self, dtype, copy=True, errors='raise', **kwargs):
"\n Cast a pandas object to a specified dtype ``dtype``.\n\n Parameters\n ----------\n dtype : data type, or dict of column name -> data type\n Use a numpy.dtype or Python type to cast entire pandas object to\n ... | 8,743,313,055,423,462,000 | Cast a pandas object to a specified dtype ``dtype``.
Parameters
----------
dtype : data type, or dict of column name -> data type
Use a numpy.dtype or Python type to cast entire pandas object to
the same type. Alternatively, use {col: dtype, ...}, where col is a
column label and dtype is a numpy.dtype or P... | pandas/core/generic.py | astype | kapilepatel/pandas | python | def astype(self, dtype, copy=True, errors='raise', **kwargs):
"\n Cast a pandas object to a specified dtype ``dtype``.\n\n Parameters\n ----------\n dtype : data type, or dict of column name -> data type\n Use a numpy.dtype or Python type to cast entire pandas object to\n ... |
def copy(self, deep=True):
'\n Make a copy of this object\'s indices and data.\n\n When ``deep=True`` (default), a new object will be created with a\n copy of the calling object\'s data and indices. Modifications to\n the data or indices of the copy will not be reflected in the\n ... | -760,128,240,262,479,000 | Make a copy of this object's indices and data.
When ``deep=True`` (default), a new object will be created with a
copy of the calling object's data and indices. Modifications to
the data or indices of the copy will not be reflected in the
original object (see notes below).
When ``deep=False``, a new object will be cre... | pandas/core/generic.py | copy | kapilepatel/pandas | python | def copy(self, deep=True):
'\n Make a copy of this object\'s indices and data.\n\n When ``deep=True`` (default), a new object will be created with a\n copy of the calling object\'s data and indices. Modifications to\n the data or indices of the copy will not be reflected in the\n ... |
def __deepcopy__(self, memo=None):
'\n Parameters\n ----------\n memo, default None\n Standard signature. Unused\n '
if (memo is None):
memo = {}
return self.copy(deep=True) | 7,599,436,350,404,427,000 | Parameters
----------
memo, default None
Standard signature. Unused | pandas/core/generic.py | __deepcopy__ | kapilepatel/pandas | python | def __deepcopy__(self, memo=None):
'\n Parameters\n ----------\n memo, default None\n Standard signature. Unused\n '
if (memo is None):
memo = {}
return self.copy(deep=True) |
def _convert(self, datetime=False, numeric=False, timedelta=False, coerce=False, copy=True):
'\n Attempt to infer better dtype for object columns\n\n Parameters\n ----------\n datetime : boolean, default False\n If True, convert to date where possible.\n numeric : boole... | -4,038,469,186,852,983,300 | Attempt to infer better dtype for object columns
Parameters
----------
datetime : boolean, default False
If True, convert to date where possible.
numeric : boolean, default False
If True, attempt to convert to numbers (including strings), with
unconvertible values becoming NaN.
timedelta : boolean, default... | pandas/core/generic.py | _convert | kapilepatel/pandas | python | def _convert(self, datetime=False, numeric=False, timedelta=False, coerce=False, copy=True):
'\n Attempt to infer better dtype for object columns\n\n Parameters\n ----------\n datetime : boolean, default False\n If True, convert to date where possible.\n numeric : boole... |
def convert_objects(self, convert_dates=True, convert_numeric=False, convert_timedeltas=True, copy=True):
"\n Attempt to infer better dtype for object columns.\n\n .. deprecated:: 0.21.0\n\n Parameters\n ----------\n convert_dates : boolean, default True\n If True, conv... | 9,178,976,238,945,957,000 | Attempt to infer better dtype for object columns.
.. deprecated:: 0.21.0
Parameters
----------
convert_dates : boolean, default True
If True, convert to date where possible. If 'coerce', force
conversion, with unconvertible values becoming NaT.
convert_numeric : boolean, default False
If True, attempt to ... | pandas/core/generic.py | convert_objects | kapilepatel/pandas | python | def convert_objects(self, convert_dates=True, convert_numeric=False, convert_timedeltas=True, copy=True):
"\n Attempt to infer better dtype for object columns.\n\n .. deprecated:: 0.21.0\n\n Parameters\n ----------\n convert_dates : boolean, default True\n If True, conv... |
def infer_objects(self):
'\n Attempt to infer better dtypes for object columns.\n\n Attempts soft conversion of object-dtyped\n columns, leaving non-object and unconvertible\n columns unchanged. The inference rules are the\n same as during normal Series/DataFrame construction.\n\n... | 2,290,033,283,622,723,600 | Attempt to infer better dtypes for object columns.
Attempts soft conversion of object-dtyped
columns, leaving non-object and unconvertible
columns unchanged. The inference rules are the
same as during normal Series/DataFrame construction.
.. versionadded:: 0.21.0
Returns
-------
converted : same type as input object... | pandas/core/generic.py | infer_objects | kapilepatel/pandas | python | def infer_objects(self):
'\n Attempt to infer better dtypes for object columns.\n\n Attempts soft conversion of object-dtyped\n columns, leaving non-object and unconvertible\n columns unchanged. The inference rules are the\n same as during normal Series/DataFrame construction.\n\n... |
def fillna(self, value=None, method=None, axis=None, inplace=False, limit=None, downcast=None):
"\n Fill NA/NaN values using the specified method.\n\n Parameters\n ----------\n value : scalar, dict, Series, or DataFrame\n Value to use to fill holes (e.g. 0), alternately a\n ... | -4,337,317,876,121,165,300 | Fill NA/NaN values using the specified method.
Parameters
----------
value : scalar, dict, Series, or DataFrame
Value to use to fill holes (e.g. 0), alternately a
dict/Series/DataFrame of values specifying which value to use for
each index (for a Series) or column (for a DataFrame). Values not
in the ... | pandas/core/generic.py | fillna | kapilepatel/pandas | python | def fillna(self, value=None, method=None, axis=None, inplace=False, limit=None, downcast=None):
"\n Fill NA/NaN values using the specified method.\n\n Parameters\n ----------\n value : scalar, dict, Series, or DataFrame\n Value to use to fill holes (e.g. 0), alternately a\n ... |
def ffill(self, axis=None, inplace=False, limit=None, downcast=None):
"\n Synonym for :meth:`DataFrame.fillna` with ``method='ffill'``.\n "
return self.fillna(method='ffill', axis=axis, inplace=inplace, limit=limit, downcast=downcast) | 5,858,174,158,121,773,000 | Synonym for :meth:`DataFrame.fillna` with ``method='ffill'``. | pandas/core/generic.py | ffill | kapilepatel/pandas | python | def ffill(self, axis=None, inplace=False, limit=None, downcast=None):
"\n \n "
return self.fillna(method='ffill', axis=axis, inplace=inplace, limit=limit, downcast=downcast) |
def bfill(self, axis=None, inplace=False, limit=None, downcast=None):
"\n Synonym for :meth:`DataFrame.fillna` with ``method='bfill'``.\n "
return self.fillna(method='bfill', axis=axis, inplace=inplace, limit=limit, downcast=downcast) | -6,281,506,511,002,993,000 | Synonym for :meth:`DataFrame.fillna` with ``method='bfill'``. | pandas/core/generic.py | bfill | kapilepatel/pandas | python | def bfill(self, axis=None, inplace=False, limit=None, downcast=None):
"\n \n "
return self.fillna(method='bfill', axis=axis, inplace=inplace, limit=limit, downcast=downcast) |
@Appender((_shared_docs['interpolate'] % _shared_doc_kwargs))
def interpolate(self, method='linear', axis=0, limit=None, inplace=False, limit_direction='forward', limit_area=None, downcast=None, **kwargs):
'\n Interpolate values according to different methods.\n '
inplace = validate_bool_kwarg(inp... | 967,257,470,192,600,600 | Interpolate values according to different methods. | pandas/core/generic.py | interpolate | kapilepatel/pandas | python | @Appender((_shared_docs['interpolate'] % _shared_doc_kwargs))
def interpolate(self, method='linear', axis=0, limit=None, inplace=False, limit_direction='forward', limit_area=None, downcast=None, **kwargs):
'\n \n '
inplace = validate_bool_kwarg(inplace, 'inplace')
if (self.ndim > 2):
r... |
def asof(self, where, subset=None):
"\n Return the last row(s) without any NaNs before `where`.\n\n The last row (for each element in `where`, if list) without any\n NaN is taken.\n In case of a :class:`~pandas.DataFrame`, the last row without NaN\n considering only the subset of ... | 4,421,495,940,943,718,000 | Return the last row(s) without any NaNs before `where`.
The last row (for each element in `where`, if list) without any
NaN is taken.
In case of a :class:`~pandas.DataFrame`, the last row without NaN
considering only the subset of columns (if not `None`)
.. versionadded:: 0.19.0 For DataFrame
If there is no good val... | pandas/core/generic.py | asof | kapilepatel/pandas | python | def asof(self, where, subset=None):
"\n Return the last row(s) without any NaNs before `where`.\n\n The last row (for each element in `where`, if list) without any\n NaN is taken.\n In case of a :class:`~pandas.DataFrame`, the last row without NaN\n considering only the subset of ... |
def clip(self, lower=None, upper=None, axis=None, inplace=False, *args, **kwargs):
"\n Trim values at input threshold(s).\n\n Assigns values outside boundary to boundary values. Thresholds\n can be singular values or array like, and in the latter case\n the clipping is performed element-... | 5,896,010,558,430,913,000 | Trim values at input threshold(s).
Assigns values outside boundary to boundary values. Thresholds
can be singular values or array like, and in the latter case
the clipping is performed element-wise in the specified axis.
Parameters
----------
lower : float or array_like, default None
Minimum threshold value. All ... | pandas/core/generic.py | clip | kapilepatel/pandas | python | def clip(self, lower=None, upper=None, axis=None, inplace=False, *args, **kwargs):
"\n Trim values at input threshold(s).\n\n Assigns values outside boundary to boundary values. Thresholds\n can be singular values or array like, and in the latter case\n the clipping is performed element-... |
def clip_upper(self, threshold, axis=None, inplace=False):
"\n Trim values above a given threshold.\n\n .. deprecated:: 0.24.0\n Use clip(upper=threshold) instead.\n\n Elements above the `threshold` will be changed to match the\n `threshold` value(s). Threshold can be a single... | 3,718,133,413,871,810,000 | Trim values above a given threshold.
.. deprecated:: 0.24.0
Use clip(upper=threshold) instead.
Elements above the `threshold` will be changed to match the
`threshold` value(s). Threshold can be a single value or an array,
in the latter case it performs the truncation element-wise.
Parameters
----------
threshold... | pandas/core/generic.py | clip_upper | kapilepatel/pandas | python | def clip_upper(self, threshold, axis=None, inplace=False):
"\n Trim values above a given threshold.\n\n .. deprecated:: 0.24.0\n Use clip(upper=threshold) instead.\n\n Elements above the `threshold` will be changed to match the\n `threshold` value(s). Threshold can be a single... |
def clip_lower(self, threshold, axis=None, inplace=False):
'\n Trim values below a given threshold.\n\n .. deprecated:: 0.24.0\n Use clip(lower=threshold) instead.\n\n Elements below the `threshold` will be changed to match the\n `threshold` value(s). Threshold can be a single... | 888,493,861,598,057,000 | Trim values below a given threshold.
.. deprecated:: 0.24.0
Use clip(lower=threshold) instead.
Elements below the `threshold` will be changed to match the
`threshold` value(s). Threshold can be a single value or an array,
in the latter case it performs the truncation element-wise.
Parameters
----------
threshold... | pandas/core/generic.py | clip_lower | kapilepatel/pandas | python | def clip_lower(self, threshold, axis=None, inplace=False):
'\n Trim values below a given threshold.\n\n .. deprecated:: 0.24.0\n Use clip(lower=threshold) instead.\n\n Elements below the `threshold` will be changed to match the\n `threshold` value(s). Threshold can be a single... |
def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True, group_keys=True, squeeze=False, observed=False, **kwargs):
'\n Group DataFrame or Series using a mapper or by a Series of columns.\n\n A groupby operation involves some combination of splitting the\n object, applying a fun... | 6,851,353,740,028,579,000 | Group DataFrame or Series using a mapper or by a Series of columns.
A groupby operation involves some combination of splitting the
object, applying a function, and combining the results. This can be
used to group large amounts of data and compute operations on these
groups.
Parameters
----------
by : mapping, functio... | pandas/core/generic.py | groupby | kapilepatel/pandas | python | def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True, group_keys=True, squeeze=False, observed=False, **kwargs):
'\n Group DataFrame or Series using a mapper or by a Series of columns.\n\n A groupby operation involves some combination of splitting the\n object, applying a fun... |
def asfreq(self, freq, method=None, how=None, normalize=False, fill_value=None):
"\n Convert TimeSeries to specified frequency.\n\n Optionally provide filling method to pad/backfill missing values.\n\n Returns the original data conformed to a new index with the specified\n frequency. ``r... | -73,085,711,971,995,800 | Convert TimeSeries to specified frequency.
Optionally provide filling method to pad/backfill missing values.
Returns the original data conformed to a new index with the specified
frequency. ``resample`` is more appropriate if an operation, such as
summarization, is necessary to represent the data at the new frequency... | pandas/core/generic.py | asfreq | kapilepatel/pandas | python | def asfreq(self, freq, method=None, how=None, normalize=False, fill_value=None):
"\n Convert TimeSeries to specified frequency.\n\n Optionally provide filling method to pad/backfill missing values.\n\n Returns the original data conformed to a new index with the specified\n frequency. ``r... |
def at_time(self, time, asof=False, axis=None):
"\n Select values at particular time of day (e.g. 9:30AM).\n\n Parameters\n ----------\n time : datetime.time or str\n axis : {0 or 'index', 1 or 'columns'}, default 0\n\n .. versionadded:: 0.24.0\n\n Returns\n ... | 1,794,167,630,809,698,000 | Select values at particular time of day (e.g. 9:30AM).
Parameters
----------
time : datetime.time or str
axis : {0 or 'index', 1 or 'columns'}, default 0
.. versionadded:: 0.24.0
Returns
-------
Series or DataFrame
Raises
------
TypeError
If the index is not a :class:`DatetimeIndex`
See Also
--------
betw... | pandas/core/generic.py | at_time | kapilepatel/pandas | python | def at_time(self, time, asof=False, axis=None):
"\n Select values at particular time of day (e.g. 9:30AM).\n\n Parameters\n ----------\n time : datetime.time or str\n axis : {0 or 'index', 1 or 'columns'}, default 0\n\n .. versionadded:: 0.24.0\n\n Returns\n ... |
def between_time(self, start_time, end_time, include_start=True, include_end=True, axis=None):
"\n Select values between particular times of the day (e.g., 9:00-9:30 AM).\n\n By setting ``start_time`` to be later than ``end_time``,\n you can get the times that are *not* between the two times.\n... | 7,100,925,896,181,392,000 | Select values between particular times of the day (e.g., 9:00-9:30 AM).
By setting ``start_time`` to be later than ``end_time``,
you can get the times that are *not* between the two times.
Parameters
----------
start_time : datetime.time or str
end_time : datetime.time or str
include_start : bool, default True
includ... | pandas/core/generic.py | between_time | kapilepatel/pandas | python | def between_time(self, start_time, end_time, include_start=True, include_end=True, axis=None):
"\n Select values between particular times of the day (e.g., 9:00-9:30 AM).\n\n By setting ``start_time`` to be later than ``end_time``,\n you can get the times that are *not* between the two times.\n... |
def resample(self, rule, how=None, axis=0, fill_method=None, closed=None, label=None, convention='start', kind=None, loffset=None, limit=None, base=0, on=None, level=None):
'\n Resample time-series data.\n\n Convenience method for frequency conversion and resampling of time\n series. Object mus... | 4,481,400,105,411,095,000 | Resample time-series data.
Convenience method for frequency conversion and resampling of time
series. Object must have a datetime-like index (`DatetimeIndex`,
`PeriodIndex`, or `TimedeltaIndex`), or pass datetime-like values
to the `on` or `level` keyword.
Parameters
----------
rule : str
The offset string or obj... | pandas/core/generic.py | resample | kapilepatel/pandas | python | def resample(self, rule, how=None, axis=0, fill_method=None, closed=None, label=None, convention='start', kind=None, loffset=None, limit=None, base=0, on=None, level=None):
'\n Resample time-series data.\n\n Convenience method for frequency conversion and resampling of time\n series. Object mus... |
def first(self, offset):
"\n Convenience method for subsetting initial periods of time series data\n based on a date offset.\n\n Parameters\n ----------\n offset : string, DateOffset, dateutil.relativedelta\n\n Returns\n -------\n subset : same type as caller\... | 7,257,172,351,481,007,000 | Convenience method for subsetting initial periods of time series data
based on a date offset.
Parameters
----------
offset : string, DateOffset, dateutil.relativedelta
Returns
-------
subset : same type as caller
Raises
------
TypeError
If the index is not a :class:`DatetimeIndex`
See Also
--------
last : Sele... | pandas/core/generic.py | first | kapilepatel/pandas | python | def first(self, offset):
"\n Convenience method for subsetting initial periods of time series data\n based on a date offset.\n\n Parameters\n ----------\n offset : string, DateOffset, dateutil.relativedelta\n\n Returns\n -------\n subset : same type as caller\... |
def last(self, offset):
"\n Convenience method for subsetting final periods of time series data\n based on a date offset.\n\n Parameters\n ----------\n offset : string, DateOffset, dateutil.relativedelta\n\n Returns\n -------\n subset : same type as caller\n\n... | -2,487,377,775,119,907,000 | Convenience method for subsetting final periods of time series data
based on a date offset.
Parameters
----------
offset : string, DateOffset, dateutil.relativedelta
Returns
-------
subset : same type as caller
Raises
------
TypeError
If the index is not a :class:`DatetimeIndex`
See Also
--------
first : Selec... | pandas/core/generic.py | last | kapilepatel/pandas | python | def last(self, offset):
"\n Convenience method for subsetting final periods of time series data\n based on a date offset.\n\n Parameters\n ----------\n offset : string, DateOffset, dateutil.relativedelta\n\n Returns\n -------\n subset : same type as caller\n\n... |
def rank(self, axis=0, method='average', numeric_only=None, na_option='keep', ascending=True, pct=False):
"\n Compute numerical data ranks (1 through n) along axis. Equal values are\n assigned a rank that is the average of the ranks of those values.\n\n Parameters\n ----------\n a... | -6,817,094,016,526,466,000 | Compute numerical data ranks (1 through n) along axis. Equal values are
assigned a rank that is the average of the ranks of those values.
Parameters
----------
axis : {0 or 'index', 1 or 'columns'}, default 0
index to direct ranking
method : {'average', 'min', 'max', 'first', 'dense'}
* average: average rank o... | pandas/core/generic.py | rank | kapilepatel/pandas | python | def rank(self, axis=0, method='average', numeric_only=None, na_option='keep', ascending=True, pct=False):
"\n Compute numerical data ranks (1 through n) along axis. Equal values are\n assigned a rank that is the average of the ranks of those values.\n\n Parameters\n ----------\n a... |
def _where(self, cond, other=np.nan, inplace=False, axis=None, level=None, errors='raise', try_cast=False):
'\n Equivalent to public method `where`, except that `other` is not\n applied as a function even if callable. Used in __setitem__.\n '
inplace = validate_bool_kwarg(inplace, 'inplace'... | 7,214,991,789,331,710,000 | Equivalent to public method `where`, except that `other` is not
applied as a function even if callable. Used in __setitem__. | pandas/core/generic.py | _where | kapilepatel/pandas | python | def _where(self, cond, other=np.nan, inplace=False, axis=None, level=None, errors='raise', try_cast=False):
'\n Equivalent to public method `where`, except that `other` is not\n applied as a function even if callable. Used in __setitem__.\n '
inplace = validate_bool_kwarg(inplace, 'inplace'... |
def slice_shift(self, periods=1, axis=0):
'\n Equivalent to `shift` without copying data. The shifted data will\n not include the dropped periods and the shifted axis will be smaller\n than the original.\n\n Parameters\n ----------\n periods : int\n Number of per... | 467,329,139,216,291,600 | Equivalent to `shift` without copying data. The shifted data will
not include the dropped periods and the shifted axis will be smaller
than the original.
Parameters
----------
periods : int
Number of periods to move, can be positive or negative
Returns
-------
shifted : same type as caller
Notes
-----
While the ... | pandas/core/generic.py | slice_shift | kapilepatel/pandas | python | def slice_shift(self, periods=1, axis=0):
'\n Equivalent to `shift` without copying data. The shifted data will\n not include the dropped periods and the shifted axis will be smaller\n than the original.\n\n Parameters\n ----------\n periods : int\n Number of per... |
def tshift(self, periods=1, freq=None, axis=0):
"\n Shift the time index, using the index's frequency if available.\n\n Parameters\n ----------\n periods : int\n Number of periods to move, can be positive or negative\n freq : DateOffset, timedelta, or time rule string, ... | 225,478,747,202,192,930 | Shift the time index, using the index's frequency if available.
Parameters
----------
periods : int
Number of periods to move, can be positive or negative
freq : DateOffset, timedelta, or time rule string, default None
Increment to use from the tseries module or time rule (e.g. 'EOM')
axis : int or basestring
... | pandas/core/generic.py | tshift | kapilepatel/pandas | python | def tshift(self, periods=1, freq=None, axis=0):
"\n Shift the time index, using the index's frequency if available.\n\n Parameters\n ----------\n periods : int\n Number of periods to move, can be positive or negative\n freq : DateOffset, timedelta, or time rule string, ... |
def truncate(self, before=None, after=None, axis=None, copy=True):
'\n Truncate a Series or DataFrame before and after some index value.\n\n This is a useful shorthand for boolean indexing based on index\n values above or below certain thresholds.\n\n Parameters\n ----------\n ... | -8,456,755,555,122,903,000 | Truncate a Series or DataFrame before and after some index value.
This is a useful shorthand for boolean indexing based on index
values above or below certain thresholds.
Parameters
----------
before : date, string, int
Truncate all rows before this index value.
after : date, string, int
Truncate all rows aft... | pandas/core/generic.py | truncate | kapilepatel/pandas | python | def truncate(self, before=None, after=None, axis=None, copy=True):
'\n Truncate a Series or DataFrame before and after some index value.\n\n This is a useful shorthand for boolean indexing based on index\n values above or below certain thresholds.\n\n Parameters\n ----------\n ... |
def tz_convert(self, tz, axis=0, level=None, copy=True):
'\n Convert tz-aware axis to target time zone.\n\n Parameters\n ----------\n tz : string or pytz.timezone object\n axis : the axis to convert\n level : int, str, default None\n If axis ia a MultiIndex, conv... | 3,158,875,932,094,216,000 | Convert tz-aware axis to target time zone.
Parameters
----------
tz : string or pytz.timezone object
axis : the axis to convert
level : int, str, default None
If axis ia a MultiIndex, convert a specific level. Otherwise
must be None
copy : boolean, default True
Also make a copy of the underlying data
Retu... | pandas/core/generic.py | tz_convert | kapilepatel/pandas | python | def tz_convert(self, tz, axis=0, level=None, copy=True):
'\n Convert tz-aware axis to target time zone.\n\n Parameters\n ----------\n tz : string or pytz.timezone object\n axis : the axis to convert\n level : int, str, default None\n If axis ia a MultiIndex, conv... |
def tz_localize(self, tz, axis=0, level=None, copy=True, ambiguous='raise', nonexistent='raise'):
"\n Localize tz-naive index of a Series or DataFrame to target time zone.\n\n This operation localizes the Index. To localize the values in a\n timezone-naive Series, use :meth:`Series.dt.tz_locali... | 3,579,135,569,935,609,300 | Localize tz-naive index of a Series or DataFrame to target time zone.
This operation localizes the Index. To localize the values in a
timezone-naive Series, use :meth:`Series.dt.tz_localize`.
Parameters
----------
tz : string or pytz.timezone object
axis : the axis to localize
level : int, str, default None
If ax... | pandas/core/generic.py | tz_localize | kapilepatel/pandas | python | def tz_localize(self, tz, axis=0, level=None, copy=True, ambiguous='raise', nonexistent='raise'):
"\n Localize tz-naive index of a Series or DataFrame to target time zone.\n\n This operation localizes the Index. To localize the values in a\n timezone-naive Series, use :meth:`Series.dt.tz_locali... |
def abs(self):
"\n Return a Series/DataFrame with absolute numeric value of each element.\n\n This function only applies to elements that are all numeric.\n\n Returns\n -------\n abs\n Series/DataFrame containing the absolute value of each element.\n\n See Also\n... | -1,500,510,702,703,974,400 | Return a Series/DataFrame with absolute numeric value of each element.
This function only applies to elements that are all numeric.
Returns
-------
abs
Series/DataFrame containing the absolute value of each element.
See Also
--------
numpy.absolute : Calculate the absolute value element-wise.
Notes
-----
For ``... | pandas/core/generic.py | abs | kapilepatel/pandas | python | def abs(self):
"\n Return a Series/DataFrame with absolute numeric value of each element.\n\n This function only applies to elements that are all numeric.\n\n Returns\n -------\n abs\n Series/DataFrame containing the absolute value of each element.\n\n See Also\n... |
def describe(self, percentiles=None, include=None, exclude=None):
'\n Generate descriptive statistics that summarize the central tendency,\n dispersion and shape of a dataset\'s distribution, excluding\n ``NaN`` values.\n\n Analyzes both numeric and object series, as well\n as ``D... | -6,582,918,210,121,776,000 | Generate descriptive statistics that summarize the central tendency,
dispersion and shape of a dataset's distribution, excluding
``NaN`` values.
Analyzes both numeric and object series, as well
as ``DataFrame`` column sets of mixed data types. The output
will vary depending on what is provided. Refer to the notes
belo... | pandas/core/generic.py | describe | kapilepatel/pandas | python | def describe(self, percentiles=None, include=None, exclude=None):
'\n Generate descriptive statistics that summarize the central tendency,\n dispersion and shape of a dataset\'s distribution, excluding\n ``NaN`` values.\n\n Analyzes both numeric and object series, as well\n as ``D... |
def _check_percentile(self, q):
'\n Validate percentiles (used by describe and quantile).\n '
msg = 'percentiles should all be in the interval [0, 1]. Try {0} instead.'
q = np.asarray(q)
if (q.ndim == 0):
if (not (0 <= q <= 1)):
raise ValueError(msg.format((q / 100.0)))... | 7,541,455,634,732,215,000 | Validate percentiles (used by describe and quantile). | pandas/core/generic.py | _check_percentile | kapilepatel/pandas | python | def _check_percentile(self, q):
'\n \n '
msg = 'percentiles should all be in the interval [0, 1]. Try {0} instead.'
q = np.asarray(q)
if (q.ndim == 0):
if (not (0 <= q <= 1)):
raise ValueError(msg.format((q / 100.0)))
elif (not all(((0 <= qs <= 1) for qs in q))):
... |
@classmethod
def _add_numeric_operations(cls):
'\n Add the operations to the cls; evaluate the doc strings again\n '
(axis_descr, name, name2) = _doc_parms(cls)
cls.any = _make_logical_function(cls, 'any', name, name2, axis_descr, _any_desc, nanops.nanany, _any_see_also, _any_examples, empty_v... | 5,735,241,837,271,939,000 | Add the operations to the cls; evaluate the doc strings again | pandas/core/generic.py | _add_numeric_operations | kapilepatel/pandas | python | @classmethod
def _add_numeric_operations(cls):
'\n \n '
(axis_descr, name, name2) = _doc_parms(cls)
cls.any = _make_logical_function(cls, 'any', name, name2, axis_descr, _any_desc, nanops.nanany, _any_see_also, _any_examples, empty_value=False)
cls.all = _make_logical_function(cls, 'all', ... |
@classmethod
def _add_series_only_operations(cls):
'\n Add the series only operations to the cls; evaluate the doc\n strings again.\n '
(axis_descr, name, name2) = _doc_parms(cls)
def nanptp(values, axis=0, skipna=True):
nmax = nanops.nanmax(values, axis, skipna)
nmin =... | 1,031,498,453,064,267,600 | Add the series only operations to the cls; evaluate the doc
strings again. | pandas/core/generic.py | _add_series_only_operations | kapilepatel/pandas | python | @classmethod
def _add_series_only_operations(cls):
'\n Add the series only operations to the cls; evaluate the doc\n strings again.\n '
(axis_descr, name, name2) = _doc_parms(cls)
def nanptp(values, axis=0, skipna=True):
nmax = nanops.nanmax(values, axis, skipna)
nmin =... |
@classmethod
def _add_series_or_dataframe_operations(cls):
'\n Add the series or dataframe only operations to the cls; evaluate\n the doc strings again.\n '
from pandas.core import window as rwindow
@Appender(rwindow.rolling.__doc__)
def rolling(self, window, min_periods=None, cent... | 194,633,612,761,821,980 | Add the series or dataframe only operations to the cls; evaluate
the doc strings again. | pandas/core/generic.py | _add_series_or_dataframe_operations | kapilepatel/pandas | python | @classmethod
def _add_series_or_dataframe_operations(cls):
'\n Add the series or dataframe only operations to the cls; evaluate\n the doc strings again.\n '
from pandas.core import window as rwindow
@Appender(rwindow.rolling.__doc__)
def rolling(self, window, min_periods=None, cent... |
def _find_valid_index(self, how):
"\n Retrieves the index of the first valid value.\n\n Parameters\n ----------\n how : {'first', 'last'}\n Use this parameter to change between the first or last valid index.\n\n Returns\n -------\n idx_first_valid : type o... | -2,625,748,619,487,744,500 | Retrieves the index of the first valid value.
Parameters
----------
how : {'first', 'last'}
Use this parameter to change between the first or last valid index.
Returns
-------
idx_first_valid : type of index | pandas/core/generic.py | _find_valid_index | kapilepatel/pandas | python | def _find_valid_index(self, how):
"\n Retrieves the index of the first valid value.\n\n Parameters\n ----------\n how : {'first', 'last'}\n Use this parameter to change between the first or last valid index.\n\n Returns\n -------\n idx_first_valid : type o... |
def __init__(self):
'\n V1RetrieveBusinessRequest - a model defined in Swagger\n\n :param dict swaggerTypes: The key is attribute name\n and the value is attribute type.\n :param dict attributeMap: The key is attribute name\n and... | -1,316,852,080,324,229,600 | V1RetrieveBusinessRequest - a model defined in Swagger
:param dict swaggerTypes: The key is attribute name
and the value is attribute type.
:param dict attributeMap: The key is attribute name
and the value is json key in definition. | squareconnect/models/v1_retrieve_business_request.py | __init__ | reduceus/connect-python-sdk | python | def __init__(self):
'\n V1RetrieveBusinessRequest - a model defined in Swagger\n\n :param dict swaggerTypes: The key is attribute name\n and the value is attribute type.\n :param dict attributeMap: The key is attribute name\n and... |
def to_dict(self):
'\n Returns the model properties as a dict\n '
result = {}
for (attr, _) in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), v... | 2,191,974,537,531,847,000 | Returns the model properties as a dict | squareconnect/models/v1_retrieve_business_request.py | to_dict | reduceus/connect-python-sdk | python | def to_dict(self):
'\n \n '
result = {}
for (attr, _) in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.