repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
modin-project/modin
modin/pandas/base.py
BasePandasDataset.all
def all(self, axis=0, bool_only=None, skipna=True, level=None, **kwargs): """Return whether all elements are True over requested axis Note: If axis=None or axis=0, this call applies df.all(axis=1) to the transpose of df. """ if axis is not None: ...
python
def all(self, axis=0, bool_only=None, skipna=True, level=None, **kwargs): """Return whether all elements are True over requested axis Note: If axis=None or axis=0, this call applies df.all(axis=1) to the transpose of df. """ if axis is not None: ...
[ "def", "all", "(", "self", ",", "axis", "=", "0", ",", "bool_only", "=", "None", ",", "skipna", "=", "True", ",", "level", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "axis", "is", "not", "None", ":", "axis", "=", "self", ".", "_get_a...
Return whether all elements are True over requested axis Note: If axis=None or axis=0, this call applies df.all(axis=1) to the transpose of df.
[ "Return", "whether", "all", "elements", "are", "True", "over", "requested", "axis", "Note", ":", "If", "axis", "=", "None", "or", "axis", "=", "0", "this", "call", "applies", "df", ".", "all", "(", "axis", "=", "1", ")", "to", "the", "transpose", "of...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L377-L415
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.apply
def apply( self, func, axis=0, broadcast=None, raw=False, reduce=None, result_type=None, convert_dtype=True, args=(), **kwds ): """Apply a function along input axis of DataFrame. Args: func: T...
python
def apply( self, func, axis=0, broadcast=None, raw=False, reduce=None, result_type=None, convert_dtype=True, args=(), **kwds ): """Apply a function along input axis of DataFrame. Args: func: T...
[ "def", "apply", "(", "self", ",", "func", ",", "axis", "=", "0", ",", "broadcast", "=", "None", ",", "raw", "=", "False", ",", "reduce", "=", "None", ",", "result_type", "=", "None", ",", "convert_dtype", "=", "True", ",", "args", "=", "(", ")", ...
Apply a function along input axis of DataFrame. Args: func: The function to apply axis: The axis over which to apply the func. broadcast: Whether or not to broadcast. raw: Whether or not to convert to a Series. reduce: Whether or not to try to ...
[ "Apply", "a", "function", "along", "input", "axis", "of", "DataFrame", ".", "Args", ":", "func", ":", "The", "function", "to", "apply", "axis", ":", "The", "axis", "over", "which", "to", "apply", "the", "func", ".", "broadcast", ":", "Whether", "or", "...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L457-L506
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.bfill
def bfill(self, axis=None, inplace=False, limit=None, downcast=None): """Synonym for DataFrame.fillna(method='bfill')""" return self.fillna( method="bfill", axis=axis, limit=limit, downcast=downcast, inplace=inplace )
python
def bfill(self, axis=None, inplace=False, limit=None, downcast=None): """Synonym for DataFrame.fillna(method='bfill')""" return self.fillna( method="bfill", axis=axis, limit=limit, downcast=downcast, inplace=inplace )
[ "def", "bfill", "(", "self", ",", "axis", "=", "None", ",", "inplace", "=", "False", ",", "limit", "=", "None", ",", "downcast", "=", "None", ")", ":", "return", "self", ".", "fillna", "(", "method", "=", "\"bfill\"", ",", "axis", "=", "axis", ",",...
Synonym for DataFrame.fillna(method='bfill')
[ "Synonym", "for", "DataFrame", ".", "fillna", "(", "method", "=", "bfill", ")" ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L577-L581
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.bool
def bool(self): """Return the bool of a single element PandasObject. This must be a boolean scalar value, either True or False. Raise a ValueError if the PandasObject does not have exactly 1 element, or that element is not boolean """ shape = self.shape ...
python
def bool(self): """Return the bool of a single element PandasObject. This must be a boolean scalar value, either True or False. Raise a ValueError if the PandasObject does not have exactly 1 element, or that element is not boolean """ shape = self.shape ...
[ "def", "bool", "(", "self", ")", ":", "shape", "=", "self", ".", "shape", "if", "shape", "!=", "(", "1", ",", ")", "and", "shape", "!=", "(", "1", ",", "1", ")", ":", "raise", "ValueError", "(", "\"\"\"The PandasObject does not have exactly\r\n ...
Return the bool of a single element PandasObject. This must be a boolean scalar value, either True or False. Raise a ValueError if the PandasObject does not have exactly 1 element, or that element is not boolean
[ "Return", "the", "bool", "of", "a", "single", "element", "PandasObject", ".", "This", "must", "be", "a", "boolean", "scalar", "value", "either", "True", "or", "False", ".", "Raise", "a", "ValueError", "if", "the", "PandasObject", "does", "not", "have", "ex...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L583-L600
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.copy
def copy(self, deep=True): """Creates a shallow copy of the DataFrame. Returns: A new DataFrame pointing to the same partitions as this one. """ return self.__constructor__(query_compiler=self._query_compiler.copy())
python
def copy(self, deep=True): """Creates a shallow copy of the DataFrame. Returns: A new DataFrame pointing to the same partitions as this one. """ return self.__constructor__(query_compiler=self._query_compiler.copy())
[ "def", "copy", "(", "self", ",", "deep", "=", "True", ")", ":", "return", "self", ".", "__constructor__", "(", "query_compiler", "=", "self", ".", "_query_compiler", ".", "copy", "(", ")", ")" ]
Creates a shallow copy of the DataFrame. Returns: A new DataFrame pointing to the same partitions as this one.
[ "Creates", "a", "shallow", "copy", "of", "the", "DataFrame", ".", "Returns", ":", "A", "new", "DataFrame", "pointing", "to", "the", "same", "partitions", "as", "this", "one", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L647-L653
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.count
def count(self, axis=0, level=None, numeric_only=False): """Get the count of non-null objects in the DataFrame. Arguments: axis: 0 or 'index' for row-wise, 1 or 'columns' for column-wise. level: If the axis is a MultiIndex (hierarchical), count along a part...
python
def count(self, axis=0, level=None, numeric_only=False): """Get the count of non-null objects in the DataFrame. Arguments: axis: 0 or 'index' for row-wise, 1 or 'columns' for column-wise. level: If the axis is a MultiIndex (hierarchical), count along a part...
[ "def", "count", "(", "self", ",", "axis", "=", "0", ",", "level", "=", "None", ",", "numeric_only", "=", "False", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", "axis", "is", "not", "None", "else", "0", "return", "s...
Get the count of non-null objects in the DataFrame. Arguments: axis: 0 or 'index' for row-wise, 1 or 'columns' for column-wise. level: If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a DataFrame. numeric_only:...
[ "Get", "the", "count", "of", "non", "-", "null", "objects", "in", "the", "DataFrame", ".", "Arguments", ":", "axis", ":", "0", "or", "index", "for", "row", "-", "wise", "1", "or", "columns", "for", "column", "-", "wise", ".", "level", ":", "If", "t...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L655-L672
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.cummax
def cummax(self, axis=None, skipna=True, *args, **kwargs): """Perform a cumulative maximum across the DataFrame. Args: axis (int): The axis to take maximum on. skipna (bool): True to skip NA values, false otherwise. Returns: The cumulative maximum of...
python
def cummax(self, axis=None, skipna=True, *args, **kwargs): """Perform a cumulative maximum across the DataFrame. Args: axis (int): The axis to take maximum on. skipna (bool): True to skip NA values, false otherwise. Returns: The cumulative maximum of...
[ "def", "cummax", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", "axis", "is", "not", "None", "else", "0...
Perform a cumulative maximum across the DataFrame. Args: axis (int): The axis to take maximum on. skipna (bool): True to skip NA values, false otherwise. Returns: The cumulative maximum of the DataFrame.
[ "Perform", "a", "cumulative", "maximum", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "maximum", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L674-L691
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.cumprod
def cumprod(self, axis=None, skipna=True, *args, **kwargs): """Perform a cumulative product across the DataFrame. Args: axis (int): The axis to take product on. skipna (bool): True to skip NA values, false otherwise. Returns: The cumulative product o...
python
def cumprod(self, axis=None, skipna=True, *args, **kwargs): """Perform a cumulative product across the DataFrame. Args: axis (int): The axis to take product on. skipna (bool): True to skip NA values, false otherwise. Returns: The cumulative product o...
[ "def", "cumprod", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", "axis", "is", "not", "None", "else", "...
Perform a cumulative product across the DataFrame. Args: axis (int): The axis to take product on. skipna (bool): True to skip NA values, false otherwise. Returns: The cumulative product of the DataFrame.
[ "Perform", "a", "cumulative", "product", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "product", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L712-L728
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.describe
def describe(self, percentiles=None, include=None, exclude=None): """ Generates descriptive statistics that summarize the central tendency, dispersion and shape of a dataset's distribution, excluding NaN values. Args: percentiles (list-like of numbers, optional): ...
python
def describe(self, percentiles=None, include=None, exclude=None): """ Generates descriptive statistics that summarize the central tendency, dispersion and shape of a dataset's distribution, excluding NaN values. Args: percentiles (list-like of numbers, optional): ...
[ "def", "describe", "(", "self", ",", "percentiles", "=", "None", ",", "include", "=", "None", ",", "exclude", "=", "None", ")", ":", "if", "include", "is", "not", "None", "and", "(", "isinstance", "(", "include", ",", "np", ".", "dtype", ")", "or", ...
Generates descriptive statistics that summarize the central tendency, dispersion and shape of a dataset's distribution, excluding NaN values. Args: percentiles (list-like of numbers, optional): The percentiles to include in the output. include: White-list o...
[ "Generates", "descriptive", "statistics", "that", "summarize", "the", "central", "tendency", "dispersion", "and", "shape", "of", "a", "dataset", "s", "distribution", "excluding", "NaN", "values", ".", "Args", ":", "percentiles", "(", "list", "-", "like", "of", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L748-L802
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.diff
def diff(self, periods=1, axis=0): """Finds the difference between elements on the axis requested Args: periods: Periods to shift for forming difference axis: Take difference over rows or columns Returns: DataFrame with the diff applied """ ...
python
def diff(self, periods=1, axis=0): """Finds the difference between elements on the axis requested Args: periods: Periods to shift for forming difference axis: Take difference over rows or columns Returns: DataFrame with the diff applied """ ...
[ "def", "diff", "(", "self", ",", "periods", "=", "1", ",", "axis", "=", "0", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "return", "self", ".", "__constructor__", "(", "query_compiler", "=", "self", ".", "_query_compiler", ...
Finds the difference between elements on the axis requested Args: periods: Periods to shift for forming difference axis: Take difference over rows or columns Returns: DataFrame with the diff applied
[ "Finds", "the", "difference", "between", "elements", "on", "the", "axis", "requested", "Args", ":", "periods", ":", "Periods", "to", "shift", "for", "forming", "difference", "axis", ":", "Take", "difference", "over", "rows", "or", "columns", "Returns", ":", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L804-L817
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.drop
def drop( self, labels=None, axis=0, index=None, columns=None, level=None, inplace=False, errors="raise", ): """Return new object with labels in requested axis removed. Args: labels: Index or column labels to dro...
python
def drop( self, labels=None, axis=0, index=None, columns=None, level=None, inplace=False, errors="raise", ): """Return new object with labels in requested axis removed. Args: labels: Index or column labels to dro...
[ "def", "drop", "(", "self", ",", "labels", "=", "None", ",", "axis", "=", "0", ",", "index", "=", "None", ",", "columns", "=", "None", ",", "level", "=", "None", ",", "inplace", "=", "False", ",", "errors", "=", "\"raise\"", ",", ")", ":", "# TOD...
Return new object with labels in requested axis removed. Args: labels: Index or column labels to drop. axis: Whether to drop labels from the index (0 / 'index') or columns (1 / 'columns'). index, columns: Alternative to specifying axis (labels, axis=1 is ...
[ "Return", "new", "object", "with", "labels", "in", "requested", "axis", "removed", ".", "Args", ":", "labels", ":", "Index", "or", "column", "labels", "to", "drop", ".", "axis", ":", "Whether", "to", "drop", "labels", "from", "the", "index", "(", "0", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L824-L918
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.dropna
def dropna(self, axis=0, how="any", thresh=None, subset=None, inplace=False): """Create a new DataFrame from the removed NA values from this one. Args: axis (int, tuple, or list): The axis to apply the drop. how (str): How to drop the NA values. 'all': drop...
python
def dropna(self, axis=0, how="any", thresh=None, subset=None, inplace=False): """Create a new DataFrame from the removed NA values from this one. Args: axis (int, tuple, or list): The axis to apply the drop. how (str): How to drop the NA values. 'all': drop...
[ "def", "dropna", "(", "self", ",", "axis", "=", "0", ",", "how", "=", "\"any\"", ",", "thresh", "=", "None", ",", "subset", "=", "None", ",", "inplace", "=", "False", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "\"inplace\"", ...
Create a new DataFrame from the removed NA values from this one. Args: axis (int, tuple, or list): The axis to apply the drop. how (str): How to drop the NA values. 'all': drop the label if all values are NA. 'any': drop the label if any values are ...
[ "Create", "a", "new", "DataFrame", "from", "the", "removed", "NA", "values", "from", "this", "one", ".", "Args", ":", "axis", "(", "int", "tuple", "or", "list", ")", ":", "The", "axis", "to", "apply", "the", "drop", ".", "how", "(", "str", ")", ":"...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L920-L967
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.drop_duplicates
def drop_duplicates(self, keep="first", inplace=False, **kwargs): """Return DataFrame with duplicate rows removed, optionally only considering certain columns Args: subset : column label or sequence of labels, optional Only consider certain columns for ident...
python
def drop_duplicates(self, keep="first", inplace=False, **kwargs): """Return DataFrame with duplicate rows removed, optionally only considering certain columns Args: subset : column label or sequence of labels, optional Only consider certain columns for ident...
[ "def", "drop_duplicates", "(", "self", ",", "keep", "=", "\"first\"", ",", "inplace", "=", "False", ",", "*", "*", "kwargs", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "\"inplace\"", ")", "if", "kwargs", ".", "get", "(", "\"sub...
Return DataFrame with duplicate rows removed, optionally only considering certain columns Args: subset : column label or sequence of labels, optional Only consider certain columns for identifying duplicates, by default use all of the columns ...
[ "Return", "DataFrame", "with", "duplicate", "rows", "removed", "optionally", "only", "considering", "certain", "columns", "Args", ":", "subset", ":", "column", "label", "or", "sequence", "of", "labels", "optional", "Only", "consider", "certain", "columns", "for", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L980-L1003
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.eq
def eq(self, other, axis="columns", level=None): """Checks element-wise that this is equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the eq over. level: The Multilevel index level to apply eq over. ...
python
def eq(self, other, axis="columns", level=None): """Checks element-wise that this is equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the eq over. level: The Multilevel index level to apply eq over. ...
[ "def", "eq", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"eq\"", ",", "other", ",", "axis", "=", "axis", ",", "level", "=", "level", ")" ]
Checks element-wise that this is equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the eq over. level: The Multilevel index level to apply eq over. Returns: A new DataFrame filled with Booleans.
[ "Checks", "element", "-", "wise", "that", "this", "is", "equal", "to", "other", ".", "Args", ":", "other", ":", "A", "DataFrame", "or", "Series", "or", "scalar", "to", "compare", "to", ".", "axis", ":", "The", "axis", "to", "perform", "the", "eq", "o...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1008-L1019
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.fillna
def fillna( self, value=None, method=None, axis=None, inplace=False, limit=None, downcast=None, **kwargs ): """Fill NA/NaN values using the specified method. Args: value: Value to use to fill holes. This value ...
python
def fillna( self, value=None, method=None, axis=None, inplace=False, limit=None, downcast=None, **kwargs ): """Fill NA/NaN values using the specified method. Args: value: Value to use to fill holes. This value ...
[ "def", "fillna", "(", "self", ",", "value", "=", "None", ",", "method", "=", "None", ",", "axis", "=", "None", ",", "inplace", "=", "False", ",", "limit", "=", "None", ",", "downcast", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# TODO impleme...
Fill NA/NaN values using the specified method. Args: value: Value to use to fill holes. This value cannot be a list. method: Method to use for filling holes in reindexed Series pad. ffill: propagate last valid observation forward to next valid bac...
[ "Fill", "NA", "/", "NaN", "values", "using", "the", "specified", "method", ".", "Args", ":", "value", ":", "Value", "to", "use", "to", "fill", "holes", ".", "This", "value", "cannot", "be", "a", "list", ".", "method", ":", "Method", "to", "use", "for...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1056-L1136
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.filter
def filter(self, items=None, like=None, regex=None, axis=None): """Subset rows or columns based on their labels Args: items (list): list of labels to subset like (string): retain labels where `arg in label == True` regex (string): retain labels matching regex i...
python
def filter(self, items=None, like=None, regex=None, axis=None): """Subset rows or columns based on their labels Args: items (list): list of labels to subset like (string): retain labels where `arg in label == True` regex (string): retain labels matching regex i...
[ "def", "filter", "(", "self", ",", "items", "=", "None", ",", "like", "=", "None", ",", "regex", "=", "None", ",", "axis", "=", "None", ")", ":", "nkw", "=", "count_not_none", "(", "items", ",", "like", ",", "regex", ")", "if", "nkw", ">", "1", ...
Subset rows or columns based on their labels Args: items (list): list of labels to subset like (string): retain labels where `arg in label == True` regex (string): retain labels matching regex input axis: axis to filter on Returns: A...
[ "Subset", "rows", "or", "columns", "based", "on", "their", "labels", "Args", ":", "items", "(", "list", ")", ":", "list", "of", "labels", "to", "subset", "like", "(", "string", ")", ":", "retain", "labels", "where", "arg", "in", "label", "==", "True", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1138-L1180
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.floordiv
def floordiv(self, other, axis="columns", level=None, fill_value=None): """Divides this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the divide against this. axis: The axis to divide over. level: The Multilevel inde...
python
def floordiv(self, other, axis="columns", level=None, fill_value=None): """Divides this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the divide against this. axis: The axis to divide over. level: The Multilevel inde...
[ "def", "floordiv", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"floordiv\"", ",", "other", ",", "axis", "=", "axis", ",", ...
Divides this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the divide against this. axis: The axis to divide over. level: The Multilevel index level to apply divide over. fill_value: The value to fill NaNs with. ...
[ "Divides", "this", "DataFrame", "against", "another", "DataFrame", "/", "Series", "/", "scalar", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "divide", "against", "this", ".", "axis", ":", "The", "axis", "to", "divi...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1193-L1207
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.ge
def ge(self, other, axis="columns", level=None): """Checks element-wise that this is greater than or equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the gt over. level: The Multilevel index level to apply gt...
python
def ge(self, other, axis="columns", level=None): """Checks element-wise that this is greater than or equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the gt over. level: The Multilevel index level to apply gt...
[ "def", "ge", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"ge\"", ",", "other", ",", "axis", "=", "axis", ",", "level", "=", "level", ")" ]
Checks element-wise that this is greater than or equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the gt over. level: The Multilevel index level to apply gt over. Returns: A new DataFrame fille...
[ "Checks", "element", "-", "wise", "that", "this", "is", "greater", "than", "or", "equal", "to", "other", ".", "Args", ":", "other", ":", "A", "DataFrame", "or", "Series", "or", "scalar", "to", "compare", "to", ".", "axis", ":", "The", "axis", "to", "...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1234-L1245
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.get_dtype_counts
def get_dtype_counts(self): """Get the counts of dtypes in this object. Returns: The counts of dtypes in this object. """ if hasattr(self, "dtype"): return pandas.Series({str(self.dtype): 1}) result = self.dtypes.value_counts() result.ind...
python
def get_dtype_counts(self): """Get the counts of dtypes in this object. Returns: The counts of dtypes in this object. """ if hasattr(self, "dtype"): return pandas.Series({str(self.dtype): 1}) result = self.dtypes.value_counts() result.ind...
[ "def", "get_dtype_counts", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "\"dtype\"", ")", ":", "return", "pandas", ".", "Series", "(", "{", "str", "(", "self", ".", "dtype", ")", ":", "1", "}", ")", "result", "=", "self", ".", "dtypes"...
Get the counts of dtypes in this object. Returns: The counts of dtypes in this object.
[ "Get", "the", "counts", "of", "dtypes", "in", "this", "object", ".", "Returns", ":", "The", "counts", "of", "dtypes", "in", "this", "object", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1264-L1274
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.get_ftype_counts
def get_ftype_counts(self): """Get the counts of ftypes in this object. Returns: The counts of ftypes in this object. """ if hasattr(self, "ftype"): return pandas.Series({self.ftype: 1}) return self.ftypes.value_counts().sort_index()
python
def get_ftype_counts(self): """Get the counts of ftypes in this object. Returns: The counts of ftypes in this object. """ if hasattr(self, "ftype"): return pandas.Series({self.ftype: 1}) return self.ftypes.value_counts().sort_index()
[ "def", "get_ftype_counts", "(", "self", ")", ":", "if", "hasattr", "(", "self", ",", "\"ftype\"", ")", ":", "return", "pandas", ".", "Series", "(", "{", "self", ".", "ftype", ":", "1", "}", ")", "return", "self", ".", "ftypes", ".", "value_counts", "...
Get the counts of ftypes in this object. Returns: The counts of ftypes in this object.
[ "Get", "the", "counts", "of", "ftypes", "in", "this", "object", ".", "Returns", ":", "The", "counts", "of", "ftypes", "in", "this", "object", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1276-L1284
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.gt
def gt(self, other, axis="columns", level=None): """Checks element-wise that this is greater than other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the gt over. level: The Multilevel index level to apply gt over. ...
python
def gt(self, other, axis="columns", level=None): """Checks element-wise that this is greater than other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the gt over. level: The Multilevel index level to apply gt over. ...
[ "def", "gt", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"gt\"", ",", "other", ",", "axis", "=", "axis", ",", "level", "=", "level", ")" ]
Checks element-wise that this is greater than other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the gt over. level: The Multilevel index level to apply gt over. Returns: A new DataFrame filled with Boole...
[ "Checks", "element", "-", "wise", "that", "this", "is", "greater", "than", "other", ".", "Args", ":", "other", ":", "A", "DataFrame", "or", "Series", "or", "scalar", "to", "compare", "to", ".", "axis", ":", "The", "axis", "to", "perform", "the", "gt", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1289-L1300
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.head
def head(self, n=5): """Get the first n rows of the DataFrame. Args: n (int): The number of rows to return. Returns: A new DataFrame with the first n rows of the DataFrame. """ if n >= len(self.index): return self.copy() re...
python
def head(self, n=5): """Get the first n rows of the DataFrame. Args: n (int): The number of rows to return. Returns: A new DataFrame with the first n rows of the DataFrame. """ if n >= len(self.index): return self.copy() re...
[ "def", "head", "(", "self", ",", "n", "=", "5", ")", ":", "if", "n", ">=", "len", "(", "self", ".", "index", ")", ":", "return", "self", ".", "copy", "(", ")", "return", "self", ".", "__constructor__", "(", "query_compiler", "=", "self", ".", "_q...
Get the first n rows of the DataFrame. Args: n (int): The number of rows to return. Returns: A new DataFrame with the first n rows of the DataFrame.
[ "Get", "the", "first", "n", "rows", "of", "the", "DataFrame", ".", "Args", ":", "n", "(", "int", ")", ":", "The", "number", "of", "rows", "to", "return", ".", "Returns", ":", "A", "new", "DataFrame", "with", "the", "first", "n", "rows", "of", "the"...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1302-L1313
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.idxmax
def idxmax(self, axis=0, skipna=True, *args, **kwargs): """Get the index of the first occurrence of the max value of the axis. Args: axis (int): Identify the max over the rows (1) or columns (0). skipna (bool): Whether or not to skip NA values. Returns: ...
python
def idxmax(self, axis=0, skipna=True, *args, **kwargs): """Get the index of the first occurrence of the max value of the axis. Args: axis (int): Identify the max over the rows (1) or columns (0). skipna (bool): Whether or not to skip NA values. Returns: ...
[ "def", "idxmax", "(", "self", ",", "axis", "=", "0", ",", "skipna", "=", "True", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "not", "all", "(", "d", "!=", "np", ".", "dtype", "(", "\"O\"", ")", "for", "d", "in", "self", ".", ...
Get the index of the first occurrence of the max value of the axis. Args: axis (int): Identify the max over the rows (1) or columns (0). skipna (bool): Whether or not to skip NA values. Returns: A Series with the index for each maximum value for the axis ...
[ "Get", "the", "index", "of", "the", "first", "occurrence", "of", "the", "max", "value", "of", "the", "axis", ".", "Args", ":", "axis", "(", "int", ")", ":", "Identify", "the", "max", "over", "the", "rows", "(", "1", ")", "or", "columns", "(", "0", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1321-L1337
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.isin
def isin(self, values): """Fill a DataFrame with booleans for cells contained in values. Args: values (iterable, DataFrame, Series, or dict): The values to find. Returns: A new DataFrame with booleans representing whether or not a cell is in values. ...
python
def isin(self, values): """Fill a DataFrame with booleans for cells contained in values. Args: values (iterable, DataFrame, Series, or dict): The values to find. Returns: A new DataFrame with booleans representing whether or not a cell is in values. ...
[ "def", "isin", "(", "self", ",", "values", ")", ":", "return", "self", ".", "__constructor__", "(", "query_compiler", "=", "self", ".", "_query_compiler", ".", "isin", "(", "values", "=", "values", ")", ")" ]
Fill a DataFrame with booleans for cells contained in values. Args: values (iterable, DataFrame, Series, or dict): The values to find. Returns: A new DataFrame with booleans representing whether or not a cell is in values. True: cell is contained...
[ "Fill", "a", "DataFrame", "with", "booleans", "for", "cells", "contained", "in", "values", ".", "Args", ":", "values", "(", "iterable", "DataFrame", "Series", "or", "dict", ")", ":", "The", "values", "to", "find", ".", "Returns", ":", "A", "new", "DataFr...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1360-L1374
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.le
def le(self, other, axis="columns", level=None): """Checks element-wise that this is less than or equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the le over. level: The Multilevel index level to apply le ov...
python
def le(self, other, axis="columns", level=None): """Checks element-wise that this is less than or equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the le over. level: The Multilevel index level to apply le ov...
[ "def", "le", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"le\"", ",", "other", ",", "axis", "=", "axis", ",", "level", "=", "level", ")" ]
Checks element-wise that this is less than or equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the le over. level: The Multilevel index level to apply le over. Returns: A new DataFrame filled w...
[ "Checks", "element", "-", "wise", "that", "this", "is", "less", "than", "or", "equal", "to", "other", ".", "Args", ":", "other", ":", "A", "DataFrame", "or", "Series", "or", "scalar", "to", "compare", "to", ".", "axis", ":", "The", "axis", "to", "per...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1435-L1446
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.lt
def lt(self, other, axis="columns", level=None): """Checks element-wise that this is less than other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the lt over. level: The Multilevel index level to apply lt over. ...
python
def lt(self, other, axis="columns", level=None): """Checks element-wise that this is less than other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the lt over. level: The Multilevel index level to apply lt over. ...
[ "def", "lt", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"lt\"", ",", "other", ",", "axis", "=", "axis", ",", "level", "=", "level", ")" ]
Checks element-wise that this is less than other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the lt over. level: The Multilevel index level to apply lt over. Returns: A new DataFrame filled with Booleans...
[ "Checks", "element", "-", "wise", "that", "this", "is", "less", "than", "other", ".", "Args", ":", "other", ":", "A", "DataFrame", "or", "Series", "or", "scalar", "to", "compare", "to", ".", "axis", ":", "The", "axis", "to", "perform", "the", "lt", "...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1448-L1459
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.mean
def mean(self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs): """Computes mean across the DataFrame. Args: axis (int): The axis to take the mean on. skipna (bool): True to skip NA values, false otherwise. Returns: The mean of the D...
python
def mean(self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs): """Computes mean across the DataFrame. Args: axis (int): The axis to take the mean on. skipna (bool): True to skip NA values, false otherwise. Returns: The mean of the D...
[ "def", "mean", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "numeric_only", "=", "None", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", ...
Computes mean across the DataFrame. Args: axis (int): The axis to take the mean on. skipna (bool): True to skip NA values, false otherwise. Returns: The mean of the DataFrame. (Pandas series)
[ "Computes", "mean", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "the", "mean", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", "otherwise", ".",...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1522-L1544
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.median
def median(self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs): """Computes median across the DataFrame. Args: axis (int): The axis to take the median on. skipna (bool): True to skip NA values, false otherwise. Returns: The median ...
python
def median(self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs): """Computes median across the DataFrame. Args: axis (int): The axis to take the median on. skipna (bool): True to skip NA values, false otherwise. Returns: The median ...
[ "def", "median", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "numeric_only", "=", "None", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if"...
Computes median across the DataFrame. Args: axis (int): The axis to take the median on. skipna (bool): True to skip NA values, false otherwise. Returns: The median of the DataFrame. (Pandas series)
[ "Computes", "median", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "the", "median", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", "otherwise", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1546-L1567
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.memory_usage
def memory_usage(self, index=True, deep=False): """Returns the memory usage of each column in bytes Args: index (bool): Whether to include the memory usage of the DataFrame's index in returned Series. Defaults to True deep (bool): If True, introspect the da...
python
def memory_usage(self, index=True, deep=False): """Returns the memory usage of each column in bytes Args: index (bool): Whether to include the memory usage of the DataFrame's index in returned Series. Defaults to True deep (bool): If True, introspect the da...
[ "def", "memory_usage", "(", "self", ",", "index", "=", "True", ",", "deep", "=", "False", ")", ":", "assert", "not", "index", ",", "\"Internal Error. Index must be evaluated in child class\"", "return", "self", ".", "_reduce_dimension", "(", "self", ".", "_query_c...
Returns the memory usage of each column in bytes Args: index (bool): Whether to include the memory usage of the DataFrame's index in returned Series. Defaults to True deep (bool): If True, introspect the data deeply by interrogating objects dtypes for s...
[ "Returns", "the", "memory", "usage", "of", "each", "column", "in", "bytes", "Args", ":", "index", "(", "bool", ")", ":", "Whether", "to", "include", "the", "memory", "usage", "of", "the", "DataFrame", "s", "index", "in", "returned", "Series", ".", "Defau...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1569-L1586
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.min
def min(self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs): """Perform min across the DataFrame. Args: axis (int): The axis to take the min on. skipna (bool): True to skip NA values, false otherwise. Returns: The min of the DataFr...
python
def min(self, axis=None, skipna=None, level=None, numeric_only=None, **kwargs): """Perform min across the DataFrame. Args: axis (int): The axis to take the min on. skipna (bool): True to skip NA values, false otherwise. Returns: The min of the DataFr...
[ "def", "min", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "numeric_only", "=", "None", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", ...
Perform min across the DataFrame. Args: axis (int): The axis to take the min on. skipna (bool): True to skip NA values, false otherwise. Returns: The min of the DataFrame.
[ "Perform", "min", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "the", "min", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", "otherwise", ".", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1588-L1608
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.mod
def mod(self, other, axis="columns", level=None, fill_value=None): """Mods this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the mod against this. axis: The axis to mod over. level: The Multilevel index level to app...
python
def mod(self, other, axis="columns", level=None, fill_value=None): """Mods this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the mod against this. axis: The axis to mod over. level: The Multilevel index level to app...
[ "def", "mod", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"mod\"", ",", "other", ",", "axis", "=", "axis", ",", "level", ...
Mods this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the mod against this. axis: The axis to mod over. level: The Multilevel index level to apply mod over. fill_value: The value to fill NaNs with. R...
[ "Mods", "this", "DataFrame", "against", "another", "DataFrame", "/", "Series", "/", "scalar", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "mod", "against", "this", ".", "axis", ":", "The", "axis", "to", "mod", "o...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1610-L1624
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.mode
def mode(self, axis=0, numeric_only=False, dropna=True): """Perform mode across the DataFrame. Args: axis (int): The axis to take the mode on. numeric_only (bool): if True, only apply to numeric columns. Returns: DataFrame: The mode of the DataFrame....
python
def mode(self, axis=0, numeric_only=False, dropna=True): """Perform mode across the DataFrame. Args: axis (int): The axis to take the mode on. numeric_only (bool): if True, only apply to numeric columns. Returns: DataFrame: The mode of the DataFrame....
[ "def", "mode", "(", "self", ",", "axis", "=", "0", ",", "numeric_only", "=", "False", ",", "dropna", "=", "True", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "return", "self", ".", "__constructor__", "(", "query_compiler", ...
Perform mode across the DataFrame. Args: axis (int): The axis to take the mode on. numeric_only (bool): if True, only apply to numeric columns. Returns: DataFrame: The mode of the DataFrame.
[ "Perform", "mode", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "the", "mode", "on", ".", "numeric_only", "(", "bool", ")", ":", "if", "True", "only", "apply", "to", "numeric", "columns", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1626-L1641
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.mul
def mul(self, other, axis="columns", level=None, fill_value=None): """Multiplies this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the multiply against this. axis: The axis to multiply over. level: The Multilevel in...
python
def mul(self, other, axis="columns", level=None, fill_value=None): """Multiplies this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the multiply against this. axis: The axis to multiply over. level: The Multilevel in...
[ "def", "mul", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"mul\"", ",", "other", ",", "axis", "=", "axis", ",", "level", ...
Multiplies this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the multiply against this. axis: The axis to multiply over. level: The Multilevel index level to apply multiply over. fill_value: The value to fill Na...
[ "Multiplies", "this", "DataFrame", "against", "another", "DataFrame", "/", "Series", "/", "scalar", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "multiply", "against", "this", ".", "axis", ":", "The", "axis", "to", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1643-L1657
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.ne
def ne(self, other, axis="columns", level=None): """Checks element-wise that this is not equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the ne over. level: The Multilevel index level to apply ne over. ...
python
def ne(self, other, axis="columns", level=None): """Checks element-wise that this is not equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the ne over. level: The Multilevel index level to apply ne over. ...
[ "def", "ne", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"ne\"", ",", "other", ",", "axis", "=", "axis", ",", "level", "=", "level", ")" ]
Checks element-wise that this is not equal to other. Args: other: A DataFrame or Series or scalar to compare to. axis: The axis to perform the ne over. level: The Multilevel index level to apply ne over. Returns: A new DataFrame filled with Boole...
[ "Checks", "element", "-", "wise", "that", "this", "is", "not", "equal", "to", "other", ".", "Args", ":", "other", ":", "A", "DataFrame", "or", "Series", "or", "scalar", "to", "compare", "to", ".", "axis", ":", "The", "axis", "to", "perform", "the", "...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1661-L1672
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.nunique
def nunique(self, axis=0, dropna=True): """Return Series with number of distinct observations over requested axis. Args: axis : {0 or 'index', 1 or 'columns'}, default 0 dropna : boolean, default True Returns: nunique : Series ""...
python
def nunique(self, axis=0, dropna=True): """Return Series with number of distinct observations over requested axis. Args: axis : {0 or 'index', 1 or 'columns'}, default 0 dropna : boolean, default True Returns: nunique : Series ""...
[ "def", "nunique", "(", "self", ",", "axis", "=", "0", ",", "dropna", "=", "True", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", "axis", "is", "not", "None", "else", "0", "return", "self", ".", "_reduce_dimension", "(...
Return Series with number of distinct observations over requested axis. Args: axis : {0 or 'index', 1 or 'columns'}, default 0 dropna : boolean, default True Returns: nunique : Series
[ "Return", "Series", "with", "number", "of", "distinct", "observations", "over", "requested", "axis", ".", "Args", ":", "axis", ":", "{", "0", "or", "index", "1", "or", "columns", "}", "default", "0", "dropna", ":", "boolean", "default", "True", "Returns", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1685-L1699
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.pow
def pow(self, other, axis="columns", level=None, fill_value=None): """Pow this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the pow against this. axis: The axis to pow over. level: The Multilevel index level to appl...
python
def pow(self, other, axis="columns", level=None, fill_value=None): """Pow this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the pow against this. axis: The axis to pow over. level: The Multilevel index level to appl...
[ "def", "pow", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"pow\"", ",", "other", ",", "axis", "=", "axis", ",", "level", ...
Pow this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the pow against this. axis: The axis to pow over. level: The Multilevel index level to apply pow over. fill_value: The value to fill NaNs with. Re...
[ "Pow", "this", "DataFrame", "against", "another", "DataFrame", "/", "Series", "/", "scalar", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "pow", "against", "this", ".", "axis", ":", "The", "axis", "to", "pow", "ov...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1738-L1752
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.prod
def prod( self, axis=None, skipna=None, level=None, numeric_only=None, min_count=0, **kwargs ): """Return the product of the values for the requested axis Args: axis : {index (0), columns (1)} skipna : bool...
python
def prod( self, axis=None, skipna=None, level=None, numeric_only=None, min_count=0, **kwargs ): """Return the product of the values for the requested axis Args: axis : {index (0), columns (1)} skipna : bool...
[ "def", "prod", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "numeric_only", "=", "None", ",", "min_count", "=", "0", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_numbe...
Return the product of the values for the requested axis Args: axis : {index (0), columns (1)} skipna : boolean, default True level : int or level name, default None numeric_only : boolean, default None min_count : int, default 0 Retu...
[ "Return", "the", "product", "of", "the", "values", "for", "the", "requested", "axis", "Args", ":", "axis", ":", "{", "index", "(", "0", ")", "columns", "(", "1", ")", "}", "skipna", ":", "boolean", "default", "True", "level", ":", "int", "or", "level...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1754-L1786
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.quantile
def quantile(self, q=0.5, axis=0, numeric_only=True, interpolation="linear"): """Return values at the given quantile over requested axis, a la numpy.percentile. Args: q (float): 0 <= q <= 1, the quantile(s) to compute axis (int): 0 or 'index' for row-wise, ...
python
def quantile(self, q=0.5, axis=0, numeric_only=True, interpolation="linear"): """Return values at the given quantile over requested axis, a la numpy.percentile. Args: q (float): 0 <= q <= 1, the quantile(s) to compute axis (int): 0 or 'index' for row-wise, ...
[ "def", "quantile", "(", "self", ",", "q", "=", "0.5", ",", "axis", "=", "0", ",", "numeric_only", "=", "True", ",", "interpolation", "=", "\"linear\"", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", "axis", "is", "not...
Return values at the given quantile over requested axis, a la numpy.percentile. Args: q (float): 0 <= q <= 1, the quantile(s) to compute axis (int): 0 or 'index' for row-wise, 1 or 'columns' for column-wise interpolation: {'linear',...
[ "Return", "values", "at", "the", "given", "quantile", "over", "requested", "axis", "a", "la", "numpy", ".", "percentile", ".", "Args", ":", "q", "(", "float", ")", ":", "0", "<", "=", "q", "<", "=", "1", "the", "quantile", "(", "s", ")", "to", "c...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1791-L1862
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.rank
def rank( self, axis=0, method="average", numeric_only=None, na_option="keep", ascending=True, pct=False, ): """ Compute numerical data ranks (1 through n) along axis. Equal values are assigned a rank that is the [method] of ...
python
def rank( self, axis=0, method="average", numeric_only=None, na_option="keep", ascending=True, pct=False, ): """ Compute numerical data ranks (1 through n) along axis. Equal values are assigned a rank that is the [method] of ...
[ "def", "rank", "(", "self", ",", "axis", "=", "0", ",", "method", "=", "\"average\"", ",", "numeric_only", "=", "None", ",", "na_option", "=", "\"keep\"", ",", "ascending", "=", "True", ",", "pct", "=", "False", ",", ")", ":", "axis", "=", "self", ...
Compute numerical data ranks (1 through n) along axis. Equal values are assigned a rank that is the [method] of the ranks of those values. Args: axis (int): 0 or 'index' for row-wise, 1 or 'columns' for column-wise method: {'average', 'min'...
[ "Compute", "numerical", "data", "ranks", "(", "1", "through", "n", ")", "along", "axis", ".", "Equal", "values", "are", "assigned", "a", "rank", "that", "is", "the", "[", "method", "]", "of", "the", "ranks", "of", "those", "values", ".", "Args", ":", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1864-L1904
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.reset_index
def reset_index( self, level=None, drop=False, inplace=False, col_level=0, col_fill="" ): """Reset this index to default and create column from current index. Args: level: Only remove the given levels from the index. Removes all levels by default ...
python
def reset_index( self, level=None, drop=False, inplace=False, col_level=0, col_fill="" ): """Reset this index to default and create column from current index. Args: level: Only remove the given levels from the index. Removes all levels by default ...
[ "def", "reset_index", "(", "self", ",", "level", "=", "None", ",", "drop", "=", "False", ",", "inplace", "=", "False", ",", "col_level", "=", "0", ",", "col_fill", "=", "\"\"", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "\"in...
Reset this index to default and create column from current index. Args: level: Only remove the given levels from the index. Removes all levels by default drop: Do not try to insert index into DataFrame columns. This resets the index to the default i...
[ "Reset", "this", "index", "to", "default", "and", "create", "column", "from", "current", "index", ".", "Args", ":", "level", ":", "Only", "remove", "the", "given", "levels", "from", "the", "index", ".", "Removes", "all", "levels", "by", "default", "drop", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2114-L2159
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.rmod
def rmod(self, other, axis="columns", level=None, fill_value=None): """Mod this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the div against this. axis: The axis to div over. level: The Multilevel index level to app...
python
def rmod(self, other, axis="columns", level=None, fill_value=None): """Mod this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the div against this. axis: The axis to div over. level: The Multilevel index level to app...
[ "def", "rmod", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"rmod\"", ",", "other", ",", "axis", "=", "axis", ",", "level"...
Mod this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the div against this. axis: The axis to div over. level: The Multilevel index level to apply div over. fill_value: The value to fill NaNs with. Re...
[ "Mod", "this", "DataFrame", "against", "another", "DataFrame", "/", "Series", "/", "scalar", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "div", "against", "this", ".", "axis", ":", "The", "axis", "to", "div", "ov...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2166-L2180
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.round
def round(self, decimals=0, *args, **kwargs): """Round each element in the DataFrame. Args: decimals: The number of decimals to round to. Returns: A new DataFrame. """ return self.__constructor__( query_compiler=self._query_compile...
python
def round(self, decimals=0, *args, **kwargs): """Round each element in the DataFrame. Args: decimals: The number of decimals to round to. Returns: A new DataFrame. """ return self.__constructor__( query_compiler=self._query_compile...
[ "def", "round", "(", "self", ",", "decimals", "=", "0", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "__constructor__", "(", "query_compiler", "=", "self", ".", "_query_compiler", ".", "round", "(", "decimals", "=", "deci...
Round each element in the DataFrame. Args: decimals: The number of decimals to round to. Returns: A new DataFrame.
[ "Round", "each", "element", "in", "the", "DataFrame", ".", "Args", ":", "decimals", ":", "The", "number", "of", "decimals", "to", "round", "to", ".", "Returns", ":", "A", "new", "DataFrame", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2205-L2216
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.rpow
def rpow(self, other, axis="columns", level=None, fill_value=None): """Pow this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the pow against this. axis: The axis to pow over. level: The Multilevel index level to app...
python
def rpow(self, other, axis="columns", level=None, fill_value=None): """Pow this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the pow against this. axis: The axis to pow over. level: The Multilevel index level to app...
[ "def", "rpow", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"rpow\"", ",", "other", ",", "axis", "=", "axis", ",", "level"...
Pow this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the pow against this. axis: The axis to pow over. level: The Multilevel index level to apply pow over. fill_value: The value to fill NaNs with. Re...
[ "Pow", "this", "DataFrame", "against", "another", "DataFrame", "/", "Series", "/", "scalar", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "pow", "against", "this", ".", "axis", ":", "The", "axis", "to", "pow", "ov...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2218-L2232
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.rsub
def rsub(self, other, axis="columns", level=None, fill_value=None): """Subtract a DataFrame/Series/scalar from this DataFrame. Args: other: The object to use to apply the subtraction to this. axis: The axis to apply the subtraction over. level: Mutlilevel index...
python
def rsub(self, other, axis="columns", level=None, fill_value=None): """Subtract a DataFrame/Series/scalar from this DataFrame. Args: other: The object to use to apply the subtraction to this. axis: The axis to apply the subtraction over. level: Mutlilevel index...
[ "def", "rsub", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"rsub\"", ",", "other", ",", "axis", "=", "axis", ",", "level"...
Subtract a DataFrame/Series/scalar from this DataFrame. Args: other: The object to use to apply the subtraction to this. axis: The axis to apply the subtraction over. level: Mutlilevel index level to subtract over. fill_value: The value to fill NaNs with. ...
[ "Subtract", "a", "DataFrame", "/", "Series", "/", "scalar", "from", "this", "DataFrame", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "subtraction", "to", "this", ".", "axis", ":", "The", "axis", "to", "apply", "t...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2234-L2248
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.rtruediv
def rtruediv(self, other, axis="columns", level=None, fill_value=None): """Div this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the div against this. axis: The axis to div over. level: The Multilevel index level to...
python
def rtruediv(self, other, axis="columns", level=None, fill_value=None): """Div this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the div against this. axis: The axis to div over. level: The Multilevel index level to...
[ "def", "rtruediv", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"rtruediv\"", ",", "other", ",", "axis", "=", "axis", ",", ...
Div this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the div against this. axis: The axis to div over. level: The Multilevel index level to apply div over. fill_value: The value to fill NaNs with. Re...
[ "Div", "this", "DataFrame", "against", "another", "DataFrame", "/", "Series", "/", "scalar", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "div", "against", "this", ".", "axis", ":", "The", "axis", "to", "div", "ov...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2250-L2264
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.sample
def sample( self, n=None, frac=None, replace=False, weights=None, random_state=None, axis=None, ): """Returns a random sample of items from an axis of object. Args: n: Number of items from axis to return. Cannot be used...
python
def sample( self, n=None, frac=None, replace=False, weights=None, random_state=None, axis=None, ): """Returns a random sample of items from an axis of object. Args: n: Number of items from axis to return. Cannot be used...
[ "def", "sample", "(", "self", ",", "n", "=", "None", ",", "frac", "=", "None", ",", "replace", "=", "False", ",", "weights", "=", "None", ",", "random_state", "=", "None", ",", "axis", "=", "None", ",", ")", ":", "axis", "=", "self", ".", "_get_a...
Returns a random sample of items from an axis of object. Args: n: Number of items from axis to return. Cannot be used with frac. Default = 1 if frac = None. frac: Fraction of axis items to return. Cannot be used with n. replace: Sample with or without r...
[ "Returns", "a", "random", "sample", "of", "items", "from", "an", "axis", "of", "object", ".", "Args", ":", "n", ":", "Number", "of", "items", "from", "axis", "to", "return", ".", "Cannot", "be", "used", "with", "frac", ".", "Default", "=", "1", "if",...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2268-L2410
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.set_axis
def set_axis(self, labels, axis=0, inplace=None): """Assign desired index to given axis. Args: labels (pandas.Index or list-like): The Index to assign. axis (string or int): The axis to reassign. inplace (bool): Whether to make these modifications inplace. ...
python
def set_axis(self, labels, axis=0, inplace=None): """Assign desired index to given axis. Args: labels (pandas.Index or list-like): The Index to assign. axis (string or int): The axis to reassign. inplace (bool): Whether to make these modifications inplace. ...
[ "def", "set_axis", "(", "self", ",", "labels", ",", "axis", "=", "0", ",", "inplace", "=", "None", ")", ":", "if", "is_scalar", "(", "labels", ")", ":", "warnings", ".", "warn", "(", "'set_axis now takes \"labels\" as first argument, and '", "'\"axis\" as named ...
Assign desired index to given axis. Args: labels (pandas.Index or list-like): The Index to assign. axis (string or int): The axis to reassign. inplace (bool): Whether to make these modifications inplace. Returns: If inplace is False, returns a ne...
[ "Assign", "desired", "index", "to", "given", "axis", ".", "Args", ":", "labels", "(", "pandas", ".", "Index", "or", "list", "-", "like", ")", ":", "The", "Index", "to", "assign", ".", "axis", "(", "string", "or", "int", ")", ":", "The", "axis", "to...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2428-L2463
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.sort_index
def sort_index( self, axis=0, level=None, ascending=True, inplace=False, kind="quicksort", na_position="last", sort_remaining=True, by=None, ): """Sort a DataFrame by one of the indices (columns or index). Args: ...
python
def sort_index( self, axis=0, level=None, ascending=True, inplace=False, kind="quicksort", na_position="last", sort_remaining=True, by=None, ): """Sort a DataFrame by one of the indices (columns or index). Args: ...
[ "def", "sort_index", "(", "self", ",", "axis", "=", "0", ",", "level", "=", "None", ",", "ascending", "=", "True", ",", "inplace", "=", "False", ",", "kind", "=", "\"quicksort\"", ",", "na_position", "=", "\"last\"", ",", "sort_remaining", "=", "True", ...
Sort a DataFrame by one of the indices (columns or index). Args: axis: The axis to sort over. level: The MultiIndex level to sort over. ascending: Ascending or descending inplace: Whether or not to update this DataFrame inplace. kind: How to pe...
[ "Sort", "a", "DataFrame", "by", "one", "of", "the", "indices", "(", "columns", "or", "index", ")", ".", "Args", ":", "axis", ":", "The", "axis", "to", "sort", "over", ".", "level", ":", "The", "MultiIndex", "level", "to", "sort", "over", ".", "ascend...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2504-L2559
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.sort_values
def sort_values( self, by, axis=0, ascending=True, inplace=False, kind="quicksort", na_position="last", ): """Sorts by a column/row or list of columns/rows. Args: by: A list of labels for the axis to sort over. ...
python
def sort_values( self, by, axis=0, ascending=True, inplace=False, kind="quicksort", na_position="last", ): """Sorts by a column/row or list of columns/rows. Args: by: A list of labels for the axis to sort over. ...
[ "def", "sort_values", "(", "self", ",", "by", ",", "axis", "=", "0", ",", "ascending", "=", "True", ",", "inplace", "=", "False", ",", "kind", "=", "\"quicksort\"", ",", "na_position", "=", "\"last\"", ",", ")", ":", "axis", "=", "self", ".", "_get_a...
Sorts by a column/row or list of columns/rows. Args: by: A list of labels for the axis to sort over. axis: The axis to sort. ascending: Sort in ascending or descending order. inplace: If true, do the operation inplace. kind: How to sort. ...
[ "Sorts", "by", "a", "column", "/", "row", "or", "list", "of", "columns", "/", "rows", ".", "Args", ":", "by", ":", "A", "list", "of", "labels", "for", "the", "axis", "to", "sort", "over", ".", "axis", ":", "The", "axis", "to", "sort", ".", "ascen...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2561-L2615
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.sub
def sub(self, other, axis="columns", level=None, fill_value=None): """Subtract a DataFrame/Series/scalar from this DataFrame. Args: other: The object to use to apply the subtraction to this. axis: The axis to apply the subtraction over. level: Mutlilevel index ...
python
def sub(self, other, axis="columns", level=None, fill_value=None): """Subtract a DataFrame/Series/scalar from this DataFrame. Args: other: The object to use to apply the subtraction to this. axis: The axis to apply the subtraction over. level: Mutlilevel index ...
[ "def", "sub", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"sub\"", ",", "other", ",", "axis", "=", "axis", ",", "level", ...
Subtract a DataFrame/Series/scalar from this DataFrame. Args: other: The object to use to apply the subtraction to this. axis: The axis to apply the subtraction over. level: Mutlilevel index level to subtract over. fill_value: The value to fill NaNs with. ...
[ "Subtract", "a", "DataFrame", "/", "Series", "/", "scalar", "from", "this", "DataFrame", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "subtraction", "to", "this", ".", "axis", ":", "The", "axis", "to", "apply", "t...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2644-L2658
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.to_numpy
def to_numpy(self, dtype=None, copy=False): """Convert the DataFrame to a NumPy array. Args: dtype: The dtype to pass to numpy.asarray() copy: Whether to ensure that the returned value is a not a view on another array. Returns: A num...
python
def to_numpy(self, dtype=None, copy=False): """Convert the DataFrame to a NumPy array. Args: dtype: The dtype to pass to numpy.asarray() copy: Whether to ensure that the returned value is a not a view on another array. Returns: A num...
[ "def", "to_numpy", "(", "self", ",", "dtype", "=", "None", ",", "copy", "=", "False", ")", ":", "return", "self", ".", "_default_to_pandas", "(", "\"to_numpy\"", ",", "dtype", "=", "dtype", ",", "copy", "=", "copy", ")" ]
Convert the DataFrame to a NumPy array. Args: dtype: The dtype to pass to numpy.asarray() copy: Whether to ensure that the returned value is a not a view on another array. Returns: A numpy array.
[ "Convert", "the", "DataFrame", "to", "a", "NumPy", "array", ".", "Args", ":", "dtype", ":", "The", "dtype", "to", "pass", "to", "numpy", ".", "asarray", "()", "copy", ":", "Whether", "to", "ensure", "that", "the", "returned", "value", "is", "a", "not",...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2901-L2912
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.truediv
def truediv(self, other, axis="columns", level=None, fill_value=None): """Divides this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the divide against this. axis: The axis to divide over. level: The Multilevel index...
python
def truediv(self, other, axis="columns", level=None, fill_value=None): """Divides this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the divide against this. axis: The axis to divide over. level: The Multilevel index...
[ "def", "truediv", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"truediv\"", ",", "other", ",", "axis", "=", "axis", ",", "...
Divides this DataFrame against another DataFrame/Series/scalar. Args: other: The object to use to apply the divide against this. axis: The axis to divide over. level: The Multilevel index level to apply divide over. fill_value: The value to fill NaNs with. ...
[ "Divides", "this", "DataFrame", "against", "another", "DataFrame", "/", "Series", "/", "scalar", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "divide", "against", "this", ".", "axis", ":", "The", "axis", "to", "divi...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L3012-L3026
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.var
def var( self, axis=None, skipna=None, level=None, ddof=1, numeric_only=None, **kwargs ): """Computes variance across the DataFrame. Args: axis (int): The axis to take the variance on. skipna (bool): True to skip NA values, false otherwise. ddof (...
python
def var( self, axis=None, skipna=None, level=None, ddof=1, numeric_only=None, **kwargs ): """Computes variance across the DataFrame. Args: axis (int): The axis to take the variance on. skipna (bool): True to skip NA values, false otherwise. ddof (...
[ "def", "var", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "ddof", "=", "1", ",", "numeric_only", "=", "None", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", ...
Computes variance across the DataFrame. Args: axis (int): The axis to take the variance on. skipna (bool): True to skip NA values, false otherwise. ddof (int): degrees of freedom Returns: The variance of the DataFrame.
[ "Computes", "variance", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "the", "variance", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", "otherwise"...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L3068-L3093
train
modin-project/modin
modin/pandas/base.py
BasePandasDataset.size
def size(self): """Get the number of elements in the DataFrame. Returns: The number of elements in the DataFrame. """ return len(self._query_compiler.index) * len(self._query_compiler.columns)
python
def size(self): """Get the number of elements in the DataFrame. Returns: The number of elements in the DataFrame. """ return len(self._query_compiler.index) * len(self._query_compiler.columns)
[ "def", "size", "(", "self", ")", ":", "return", "len", "(", "self", ".", "_query_compiler", ".", "index", ")", "*", "len", "(", "self", ".", "_query_compiler", ".", "columns", ")" ]
Get the number of elements in the DataFrame. Returns: The number of elements in the DataFrame.
[ "Get", "the", "number", "of", "elements", "in", "the", "DataFrame", ".", "Returns", ":", "The", "number", "of", "elements", "in", "the", "DataFrame", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L3238-L3244
train
modin-project/modin
modin/engines/python/pandas_on_python/frame/partition.py
PandasOnPythonFramePartition.get
def get(self): """Flushes the call_queue and returns the data. Note: Since this object is a simple wrapper, just return the data. Returns: The object that was `put`. """ if self.call_queue: return self.apply(lambda df: df).data else: ...
python
def get(self): """Flushes the call_queue and returns the data. Note: Since this object is a simple wrapper, just return the data. Returns: The object that was `put`. """ if self.call_queue: return self.apply(lambda df: df).data else: ...
[ "def", "get", "(", "self", ")", ":", "if", "self", ".", "call_queue", ":", "return", "self", ".", "apply", "(", "lambda", "df", ":", "df", ")", ".", "data", "else", ":", "return", "self", ".", "data", ".", "copy", "(", ")" ]
Flushes the call_queue and returns the data. Note: Since this object is a simple wrapper, just return the data. Returns: The object that was `put`.
[ "Flushes", "the", "call_queue", "and", "returns", "the", "data", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/python/pandas_on_python/frame/partition.py#L23-L34
train
modin-project/modin
modin/engines/python/pandas_on_python/frame/partition.py
PandasOnPythonFramePartition.apply
def apply(self, func, **kwargs): """Apply some callable function to the data in this partition. Note: It is up to the implementation how kwargs are handled. They are an important part of many implementations. As of right now, they are not serialized. Args: f...
python
def apply(self, func, **kwargs): """Apply some callable function to the data in this partition. Note: It is up to the implementation how kwargs are handled. They are an important part of many implementations. As of right now, they are not serialized. Args: f...
[ "def", "apply", "(", "self", ",", "func", ",", "*", "*", "kwargs", ")", ":", "self", ".", "call_queue", ".", "append", "(", "(", "func", ",", "kwargs", ")", ")", "def", "call_queue_closure", "(", "data", ",", "call_queues", ")", ":", "result", "=", ...
Apply some callable function to the data in this partition. Note: It is up to the implementation how kwargs are handled. They are an important part of many implementations. As of right now, they are not serialized. Args: func: The lambda to apply (may already be cor...
[ "Apply", "some", "callable", "function", "to", "the", "data", "in", "this", "partition", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/python/pandas_on_python/frame/partition.py#L36-L64
train
modin-project/modin
modin/engines/dask/pandas_on_dask_delayed/frame/partition.py
DaskFramePartition.apply
def apply(self, func, **kwargs): """Apply some callable function to the data in this partition. Note: It is up to the implementation how kwargs are handled. They are an important part of many implementations. As of right now, they are not serialized. Args: f...
python
def apply(self, func, **kwargs): """Apply some callable function to the data in this partition. Note: It is up to the implementation how kwargs are handled. They are an important part of many implementations. As of right now, they are not serialized. Args: f...
[ "def", "apply", "(", "self", ",", "func", ",", "*", "*", "kwargs", ")", ":", "import", "dask", "# applies the func lazily", "delayed_call", "=", "self", ".", "delayed_call", "self", ".", "delayed_call", "=", "self", ".", "dask_obj", "return", "self", ".", ...
Apply some callable function to the data in this partition. Note: It is up to the implementation how kwargs are handled. They are an important part of many implementations. As of right now, they are not serialized. Args: func: The lambda to apply (may already be cor...
[ "Apply", "some", "callable", "function", "to", "the", "data", "in", "this", "partition", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/dask/pandas_on_dask_delayed/frame/partition.py#L29-L48
train
modin-project/modin
modin/engines/dask/pandas_on_dask_delayed/frame/partition.py
DaskFramePartition.add_to_apply_calls
def add_to_apply_calls(self, func, **kwargs): """Add the function to the apply function call stack. This function will be executed when apply is called. It will be executed in the order inserted; apply's func operates the last and return """ import dask self.delayed_cal...
python
def add_to_apply_calls(self, func, **kwargs): """Add the function to the apply function call stack. This function will be executed when apply is called. It will be executed in the order inserted; apply's func operates the last and return """ import dask self.delayed_cal...
[ "def", "add_to_apply_calls", "(", "self", ",", "func", ",", "*", "*", "kwargs", ")", ":", "import", "dask", "self", ".", "delayed_call", "=", "dask", ".", "delayed", "(", "func", ")", "(", "self", ".", "delayed_call", ",", "*", "*", "kwargs", ")", "r...
Add the function to the apply function call stack. This function will be executed when apply is called. It will be executed in the order inserted; apply's func operates the last and return
[ "Add", "the", "function", "to", "the", "apply", "function", "call", "stack", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/dask/pandas_on_dask_delayed/frame/partition.py#L50-L59
train
modin-project/modin
modin/experimental/engines/pyarrow_on_ray/io.py
_read_csv_with_offset_pyarrow_on_ray
def _read_csv_with_offset_pyarrow_on_ray( fname, num_splits, start, end, kwargs, header ): # pragma: no cover """Use a Ray task to read a chunk of a CSV into a pyarrow Table. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: fname: The filename of the file to open....
python
def _read_csv_with_offset_pyarrow_on_ray( fname, num_splits, start, end, kwargs, header ): # pragma: no cover """Use a Ray task to read a chunk of a CSV into a pyarrow Table. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: fname: The filename of the file to open....
[ "def", "_read_csv_with_offset_pyarrow_on_ray", "(", "fname", ",", "num_splits", ",", "start", ",", "end", ",", "kwargs", ",", "header", ")", ":", "# pragma: no cover", "bio", "=", "open", "(", "fname", ",", "\"rb\"", ")", "# The header line for the CSV file", "fir...
Use a Ray task to read a chunk of a CSV into a pyarrow Table. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: fname: The filename of the file to open. num_splits: The number of splits (partitions) to separate the DataFrame into. start: The start byte offse...
[ "Use", "a", "Ray", "task", "to", "read", "a", "chunk", "of", "a", "CSV", "into", "a", "pyarrow", "Table", ".", "Note", ":", "Ray", "functions", "are", "not", "detected", "by", "codecov", "(", "thus", "pragma", ":", "no", "cover", ")", "Args", ":", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/experimental/engines/pyarrow_on_ray/io.py#L23-L54
train
modin-project/modin
modin/data_management/utils.py
compute_chunksize
def compute_chunksize(df, num_splits, default_block_size=32, axis=None): """Computes the number of rows and/or columns to include in each partition. Args: df: The DataFrame to split. num_splits: The maximum number of splits to separate the DataFrame into. default_block_size: Minimum num...
python
def compute_chunksize(df, num_splits, default_block_size=32, axis=None): """Computes the number of rows and/or columns to include in each partition. Args: df: The DataFrame to split. num_splits: The maximum number of splits to separate the DataFrame into. default_block_size: Minimum num...
[ "def", "compute_chunksize", "(", "df", ",", "num_splits", ",", "default_block_size", "=", "32", ",", "axis", "=", "None", ")", ":", "if", "axis", "==", "0", "or", "axis", "is", "None", ":", "row_chunksize", "=", "get_default_chunksize", "(", "len", "(", ...
Computes the number of rows and/or columns to include in each partition. Args: df: The DataFrame to split. num_splits: The maximum number of splits to separate the DataFrame into. default_block_size: Minimum number of rows/columns (default set to 32x32). axis: The axis to split. (0:...
[ "Computes", "the", "number", "of", "rows", "and", "/", "or", "columns", "to", "include", "in", "each", "partition", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/data_management/utils.py#L24-L52
train
modin-project/modin
modin/data_management/utils.py
_get_nan_block_id
def _get_nan_block_id(partition_class, n_row=1, n_col=1, transpose=False): """A memory efficient way to get a block of NaNs. Args: partition_class (BaseFramePartition): The class to use to put the object in the remote format. n_row(int): The number of rows. n_col(int): The n...
python
def _get_nan_block_id(partition_class, n_row=1, n_col=1, transpose=False): """A memory efficient way to get a block of NaNs. Args: partition_class (BaseFramePartition): The class to use to put the object in the remote format. n_row(int): The number of rows. n_col(int): The n...
[ "def", "_get_nan_block_id", "(", "partition_class", ",", "n_row", "=", "1", ",", "n_col", "=", "1", ",", "transpose", "=", "False", ")", ":", "global", "_NAN_BLOCKS", "if", "transpose", ":", "n_row", ",", "n_col", "=", "n_col", ",", "n_row", "shape", "="...
A memory efficient way to get a block of NaNs. Args: partition_class (BaseFramePartition): The class to use to put the object in the remote format. n_row(int): The number of rows. n_col(int): The number of columns. transpose(bool): If true, swap rows and columns. Ret...
[ "A", "memory", "efficient", "way", "to", "get", "a", "block", "of", "NaNs", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/data_management/utils.py#L55-L75
train
modin-project/modin
modin/data_management/utils.py
split_result_of_axis_func_pandas
def split_result_of_axis_func_pandas(axis, num_splits, result, length_list=None): """Split the Pandas result evenly based on the provided number of splits. Args: axis: The axis to split across. num_splits: The number of even splits to create. result: The result of the computation. This ...
python
def split_result_of_axis_func_pandas(axis, num_splits, result, length_list=None): """Split the Pandas result evenly based on the provided number of splits. Args: axis: The axis to split across. num_splits: The number of even splits to create. result: The result of the computation. This ...
[ "def", "split_result_of_axis_func_pandas", "(", "axis", ",", "num_splits", ",", "result", ",", "length_list", "=", "None", ")", ":", "if", "num_splits", "==", "1", ":", "return", "result", "if", "length_list", "is", "not", "None", ":", "length_list", ".", "i...
Split the Pandas result evenly based on the provided number of splits. Args: axis: The axis to split across. num_splits: The number of even splits to create. result: The result of the computation. This should be a Pandas DataFrame. length_list: The list of lengths to spl...
[ "Split", "the", "Pandas", "result", "evenly", "based", "on", "the", "provided", "number", "of", "splits", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/data_management/utils.py#L78-L111
train
modin-project/modin
modin/pandas/indexing.py
_parse_tuple
def _parse_tuple(tup): """Unpack the user input for getitem and setitem and compute ndim loc[a] -> ([a], :), 1D loc[[a,b],] -> ([a,b], :), loc[a,b] -> ([a], [b]), 0D """ row_loc, col_loc = slice(None), slice(None) if is_tuple(tup): row_loc = tup[0] if len(tup) == 2: ...
python
def _parse_tuple(tup): """Unpack the user input for getitem and setitem and compute ndim loc[a] -> ([a], :), 1D loc[[a,b],] -> ([a,b], :), loc[a,b] -> ([a], [b]), 0D """ row_loc, col_loc = slice(None), slice(None) if is_tuple(tup): row_loc = tup[0] if len(tup) == 2: ...
[ "def", "_parse_tuple", "(", "tup", ")", ":", "row_loc", ",", "col_loc", "=", "slice", "(", "None", ")", ",", "slice", "(", "None", ")", "if", "is_tuple", "(", "tup", ")", ":", "row_loc", "=", "tup", "[", "0", "]", "if", "len", "(", "tup", ")", ...
Unpack the user input for getitem and setitem and compute ndim loc[a] -> ([a], :), 1D loc[[a,b],] -> ([a,b], :), loc[a,b] -> ([a], [b]), 0D
[ "Unpack", "the", "user", "input", "for", "getitem", "and", "setitem", "and", "compute", "ndim" ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L77-L101
train
modin-project/modin
modin/pandas/indexing.py
_is_enlargement
def _is_enlargement(locator, global_index): """Determine if a locator will enlarge the global index. Enlargement happens when you trying to locate using labels isn't in the original index. In other words, enlargement == adding NaNs ! """ if ( is_list_like(locator) and not is_slice(l...
python
def _is_enlargement(locator, global_index): """Determine if a locator will enlarge the global index. Enlargement happens when you trying to locate using labels isn't in the original index. In other words, enlargement == adding NaNs ! """ if ( is_list_like(locator) and not is_slice(l...
[ "def", "_is_enlargement", "(", "locator", ",", "global_index", ")", ":", "if", "(", "is_list_like", "(", "locator", ")", "and", "not", "is_slice", "(", "locator", ")", "and", "len", "(", "locator", ")", ">", "0", "and", "not", "is_boolean_array", "(", "l...
Determine if a locator will enlarge the global index. Enlargement happens when you trying to locate using labels isn't in the original index. In other words, enlargement == adding NaNs !
[ "Determine", "if", "a", "locator", "will", "enlarge", "the", "global", "index", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L104-L120
train
modin-project/modin
modin/pandas/indexing.py
_compute_ndim
def _compute_ndim(row_loc, col_loc): """Compute the ndim of result from locators """ row_scaler = is_scalar(row_loc) col_scaler = is_scalar(col_loc) if row_scaler and col_scaler: ndim = 0 elif row_scaler ^ col_scaler: ndim = 1 else: ndim = 2 return ndim
python
def _compute_ndim(row_loc, col_loc): """Compute the ndim of result from locators """ row_scaler = is_scalar(row_loc) col_scaler = is_scalar(col_loc) if row_scaler and col_scaler: ndim = 0 elif row_scaler ^ col_scaler: ndim = 1 else: ndim = 2 return ndim
[ "def", "_compute_ndim", "(", "row_loc", ",", "col_loc", ")", ":", "row_scaler", "=", "is_scalar", "(", "row_loc", ")", "col_scaler", "=", "is_scalar", "(", "col_loc", ")", "if", "row_scaler", "and", "col_scaler", ":", "ndim", "=", "0", "elif", "row_scaler", ...
Compute the ndim of result from locators
[ "Compute", "the", "ndim", "of", "result", "from", "locators" ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L127-L140
train
modin-project/modin
modin/pandas/indexing.py
_LocationIndexerBase._broadcast_item
def _broadcast_item(self, row_lookup, col_lookup, item, to_shape): """Use numpy to broadcast or reshape item. Notes: - Numpy is memory efficient, there shouldn't be performance issue. """ # It is valid to pass a DataFrame or Series to __setitem__ that is larger than ...
python
def _broadcast_item(self, row_lookup, col_lookup, item, to_shape): """Use numpy to broadcast or reshape item. Notes: - Numpy is memory efficient, there shouldn't be performance issue. """ # It is valid to pass a DataFrame or Series to __setitem__ that is larger than ...
[ "def", "_broadcast_item", "(", "self", ",", "row_lookup", ",", "col_lookup", ",", "item", ",", "to_shape", ")", ":", "# It is valid to pass a DataFrame or Series to __setitem__ that is larger than", "# the target the user is trying to overwrite. This", "if", "isinstance", "(", ...
Use numpy to broadcast or reshape item. Notes: - Numpy is memory efficient, there shouldn't be performance issue.
[ "Use", "numpy", "to", "broadcast", "or", "reshape", "item", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L187-L221
train
modin-project/modin
modin/pandas/indexing.py
_LocationIndexerBase._write_items
def _write_items(self, row_lookup, col_lookup, item): """Perform remote write and replace blocks. """ self.qc.write_items(row_lookup, col_lookup, item)
python
def _write_items(self, row_lookup, col_lookup, item): """Perform remote write and replace blocks. """ self.qc.write_items(row_lookup, col_lookup, item)
[ "def", "_write_items", "(", "self", ",", "row_lookup", ",", "col_lookup", ",", "item", ")", ":", "self", ".", "qc", ".", "write_items", "(", "row_lookup", ",", "col_lookup", ",", "item", ")" ]
Perform remote write and replace blocks.
[ "Perform", "remote", "write", "and", "replace", "blocks", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L223-L226
train
modin-project/modin
modin/pandas/indexing.py
_LocIndexer._handle_enlargement
def _handle_enlargement(self, row_loc, col_loc): """Handle Enlargement (if there is one). Returns: None """ if _is_enlargement(row_loc, self.qc.index) or _is_enlargement( col_loc, self.qc.columns ): _warn_enlargement() self.qc.enla...
python
def _handle_enlargement(self, row_loc, col_loc): """Handle Enlargement (if there is one). Returns: None """ if _is_enlargement(row_loc, self.qc.index) or _is_enlargement( col_loc, self.qc.columns ): _warn_enlargement() self.qc.enla...
[ "def", "_handle_enlargement", "(", "self", ",", "row_loc", ",", "col_loc", ")", ":", "if", "_is_enlargement", "(", "row_loc", ",", "self", ".", "qc", ".", "index", ")", "or", "_is_enlargement", "(", "col_loc", ",", "self", ".", "qc", ".", "columns", ")",...
Handle Enlargement (if there is one). Returns: None
[ "Handle", "Enlargement", "(", "if", "there", "is", "one", ")", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L279-L292
train
modin-project/modin
modin/pandas/indexing.py
_LocIndexer._compute_enlarge_labels
def _compute_enlarge_labels(self, locator, base_index): """Helper for _enlarge_axis, compute common labels and extra labels. Returns: nan_labels: The labels needs to be added """ # base_index_type can be pd.Index or pd.DatetimeIndex # depending on user input and pan...
python
def _compute_enlarge_labels(self, locator, base_index): """Helper for _enlarge_axis, compute common labels and extra labels. Returns: nan_labels: The labels needs to be added """ # base_index_type can be pd.Index or pd.DatetimeIndex # depending on user input and pan...
[ "def", "_compute_enlarge_labels", "(", "self", ",", "locator", ",", "base_index", ")", ":", "# base_index_type can be pd.Index or pd.DatetimeIndex", "# depending on user input and pandas behavior", "# See issue #2264", "base_index_type", "=", "type", "(", "base_index", ")", "lo...
Helper for _enlarge_axis, compute common labels and extra labels. Returns: nan_labels: The labels needs to be added
[ "Helper", "for", "_enlarge_axis", "compute", "common", "labels", "and", "extra", "labels", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L294-L315
train
modin-project/modin
modin/engines/ray/pandas_on_ray/io.py
_split_result_for_readers
def _split_result_for_readers(axis, num_splits, df): # pragma: no cover """Splits the DataFrame read into smaller DataFrames and handles all edge cases. Args: axis: Which axis to split over. num_splits: The number of splits to create. df: The DataFrame after it has been read. Retu...
python
def _split_result_for_readers(axis, num_splits, df): # pragma: no cover """Splits the DataFrame read into smaller DataFrames and handles all edge cases. Args: axis: Which axis to split over. num_splits: The number of splits to create. df: The DataFrame after it has been read. Retu...
[ "def", "_split_result_for_readers", "(", "axis", ",", "num_splits", ",", "df", ")", ":", "# pragma: no cover", "splits", "=", "split_result_of_axis_func_pandas", "(", "axis", ",", "num_splits", ",", "df", ")", "if", "not", "isinstance", "(", "splits", ",", "list...
Splits the DataFrame read into smaller DataFrames and handles all edge cases. Args: axis: Which axis to split over. num_splits: The number of splits to create. df: The DataFrame after it has been read. Returns: A list of pandas DataFrames.
[ "Splits", "the", "DataFrame", "read", "into", "smaller", "DataFrames", "and", "handles", "all", "edge", "cases", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L18-L32
train
modin-project/modin
modin/engines/ray/pandas_on_ray/io.py
_read_parquet_columns
def _read_parquet_columns(path, columns, num_splits, kwargs): # pragma: no cover """Use a Ray task to read columns from Parquet into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: path: The path of the Parquet file. columns: The list of c...
python
def _read_parquet_columns(path, columns, num_splits, kwargs): # pragma: no cover """Use a Ray task to read columns from Parquet into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: path: The path of the Parquet file. columns: The list of c...
[ "def", "_read_parquet_columns", "(", "path", ",", "columns", ",", "num_splits", ",", "kwargs", ")", ":", "# pragma: no cover", "import", "pyarrow", ".", "parquet", "as", "pq", "df", "=", "pq", ".", "read_pandas", "(", "path", ",", "columns", "=", "columns", ...
Use a Ray task to read columns from Parquet into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: path: The path of the Parquet file. columns: The list of column names to read. num_splits: The number of partitions to split the column int...
[ "Use", "a", "Ray", "task", "to", "read", "columns", "from", "Parquet", "into", "a", "Pandas", "DataFrame", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L36-L56
train
modin-project/modin
modin/engines/ray/pandas_on_ray/io.py
_read_csv_with_offset_pandas_on_ray
def _read_csv_with_offset_pandas_on_ray( fname, num_splits, start, end, kwargs, header ): # pragma: no cover """Use a Ray task to read a chunk of a CSV into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: fname: The filename of the file to ope...
python
def _read_csv_with_offset_pandas_on_ray( fname, num_splits, start, end, kwargs, header ): # pragma: no cover """Use a Ray task to read a chunk of a CSV into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: fname: The filename of the file to ope...
[ "def", "_read_csv_with_offset_pandas_on_ray", "(", "fname", ",", "num_splits", ",", "start", ",", "end", ",", "kwargs", ",", "header", ")", ":", "# pragma: no cover", "index_col", "=", "kwargs", ".", "get", "(", "\"index_col\"", ",", "None", ")", "bio", "=", ...
Use a Ray task to read a chunk of a CSV into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: fname: The filename of the file to open. num_splits: The number of splits (partitions) to separate the DataFrame into. start: The start byte of...
[ "Use", "a", "Ray", "task", "to", "read", "a", "chunk", "of", "a", "CSV", "into", "a", "Pandas", "DataFrame", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L60-L96
train
modin-project/modin
modin/engines/ray/pandas_on_ray/io.py
_read_hdf_columns
def _read_hdf_columns(path_or_buf, columns, num_splits, kwargs): # pragma: no cover """Use a Ray task to read columns from HDF5 into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: path_or_buf: The path of the HDF5 file. columns: The list ...
python
def _read_hdf_columns(path_or_buf, columns, num_splits, kwargs): # pragma: no cover """Use a Ray task to read columns from HDF5 into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: path_or_buf: The path of the HDF5 file. columns: The list ...
[ "def", "_read_hdf_columns", "(", "path_or_buf", ",", "columns", ",", "num_splits", ",", "kwargs", ")", ":", "# pragma: no cover", "df", "=", "pandas", ".", "read_hdf", "(", "path_or_buf", ",", "columns", "=", "columns", ",", "*", "*", "kwargs", ")", "# Appen...
Use a Ray task to read columns from HDF5 into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: path_or_buf: The path of the HDF5 file. columns: The list of column names to read. num_splits: The number of partitions to split the column in...
[ "Use", "a", "Ray", "task", "to", "read", "columns", "from", "HDF5", "into", "a", "Pandas", "DataFrame", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L100-L119
train
modin-project/modin
modin/engines/ray/pandas_on_ray/io.py
_read_feather_columns
def _read_feather_columns(path, columns, num_splits): # pragma: no cover """Use a Ray task to read columns from Feather into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: path: The path of the Feather file. columns: The list of column na...
python
def _read_feather_columns(path, columns, num_splits): # pragma: no cover """Use a Ray task to read columns from Feather into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: path: The path of the Feather file. columns: The list of column na...
[ "def", "_read_feather_columns", "(", "path", ",", "columns", ",", "num_splits", ")", ":", "# pragma: no cover", "from", "pyarrow", "import", "feather", "df", "=", "feather", ".", "read_feather", "(", "path", ",", "columns", "=", "columns", ")", "# Append the len...
Use a Ray task to read columns from Feather into a Pandas DataFrame. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: path: The path of the Feather file. columns: The list of column names to read. num_splits: The number of partitions to split the column int...
[ "Use", "a", "Ray", "task", "to", "read", "columns", "from", "Feather", "into", "a", "Pandas", "DataFrame", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L123-L143
train
modin-project/modin
modin/engines/ray/pandas_on_ray/io.py
_read_sql_with_limit_offset
def _read_sql_with_limit_offset( num_splits, sql, con, index_col, kwargs ): # pragma: no cover """Use a Ray task to read a chunk of SQL source. Note: Ray functions are not detected by codecov (thus pragma: no cover) """ pandas_df = pandas.read_sql(sql, con, index_col=index_col, **kwargs) if in...
python
def _read_sql_with_limit_offset( num_splits, sql, con, index_col, kwargs ): # pragma: no cover """Use a Ray task to read a chunk of SQL source. Note: Ray functions are not detected by codecov (thus pragma: no cover) """ pandas_df = pandas.read_sql(sql, con, index_col=index_col, **kwargs) if in...
[ "def", "_read_sql_with_limit_offset", "(", "num_splits", ",", "sql", ",", "con", ",", "index_col", ",", "kwargs", ")", ":", "# pragma: no cover", "pandas_df", "=", "pandas", ".", "read_sql", "(", "sql", ",", "con", ",", "index_col", "=", "index_col", ",", "*...
Use a Ray task to read a chunk of SQL source. Note: Ray functions are not detected by codecov (thus pragma: no cover)
[ "Use", "a", "Ray", "task", "to", "read", "a", "chunk", "of", "SQL", "source", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L147-L159
train
modin-project/modin
modin/engines/ray/generic/io.py
get_index
def get_index(index_name, *partition_indices): # pragma: no cover """Get the index from the indices returned by the workers. Note: Ray functions are not detected by codecov (thus pragma: no cover)""" index = partition_indices[0].append(partition_indices[1:]) index.names = index_name return index
python
def get_index(index_name, *partition_indices): # pragma: no cover """Get the index from the indices returned by the workers. Note: Ray functions are not detected by codecov (thus pragma: no cover)""" index = partition_indices[0].append(partition_indices[1:]) index.names = index_name return index
[ "def", "get_index", "(", "index_name", ",", "*", "partition_indices", ")", ":", "# pragma: no cover", "index", "=", "partition_indices", "[", "0", "]", ".", "append", "(", "partition_indices", "[", "1", ":", "]", ")", "index", ".", "names", "=", "index_name"...
Get the index from the indices returned by the workers. Note: Ray functions are not detected by codecov (thus pragma: no cover)
[ "Get", "the", "index", "from", "the", "indices", "returned", "by", "the", "workers", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L64-L70
train
modin-project/modin
modin/engines/ray/generic/io.py
RayIO.read_parquet
def read_parquet(cls, path, engine, columns, **kwargs): """Load a parquet object from the file path, returning a DataFrame. Ray DataFrame only supports pyarrow engine for now. Args: path: The filepath of the parquet file. We only support local files for now. ...
python
def read_parquet(cls, path, engine, columns, **kwargs): """Load a parquet object from the file path, returning a DataFrame. Ray DataFrame only supports pyarrow engine for now. Args: path: The filepath of the parquet file. We only support local files for now. ...
[ "def", "read_parquet", "(", "cls", ",", "path", ",", "engine", ",", "columns", ",", "*", "*", "kwargs", ")", ":", "from", "pyarrow", ".", "parquet", "import", "ParquetFile", "if", "cls", ".", "read_parquet_remote_task", "is", "None", ":", "return", "super"...
Load a parquet object from the file path, returning a DataFrame. Ray DataFrame only supports pyarrow engine for now. Args: path: The filepath of the parquet file. We only support local files for now. engine: Ray only support pyarrow reader. ...
[ "Load", "a", "parquet", "object", "from", "the", "file", "path", "returning", "a", "DataFrame", ".", "Ray", "DataFrame", "only", "supports", "pyarrow", "engine", "for", "now", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L129-L193
train
modin-project/modin
modin/engines/ray/generic/io.py
RayIO._read_csv_from_file_pandas_on_ray
def _read_csv_from_file_pandas_on_ray(cls, filepath, kwargs={}): """Constructs a DataFrame from a CSV file. Args: filepath (str): path to the CSV file. npartitions (int): number of partitions for the DataFrame. kwargs (dict): args excluding filepath provided to read_...
python
def _read_csv_from_file_pandas_on_ray(cls, filepath, kwargs={}): """Constructs a DataFrame from a CSV file. Args: filepath (str): path to the CSV file. npartitions (int): number of partitions for the DataFrame. kwargs (dict): args excluding filepath provided to read_...
[ "def", "_read_csv_from_file_pandas_on_ray", "(", "cls", ",", "filepath", ",", "kwargs", "=", "{", "}", ")", ":", "names", "=", "kwargs", ".", "get", "(", "\"names\"", ",", "None", ")", "index_col", "=", "kwargs", ".", "get", "(", "\"index_col\"", ",", "N...
Constructs a DataFrame from a CSV file. Args: filepath (str): path to the CSV file. npartitions (int): number of partitions for the DataFrame. kwargs (dict): args excluding filepath provided to read_csv. Returns: DataFrame or Series constructed from CSV ...
[ "Constructs", "a", "DataFrame", "from", "a", "CSV", "file", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L242-L357
train
modin-project/modin
modin/engines/ray/generic/io.py
RayIO._read
def _read(cls, filepath_or_buffer, **kwargs): """Read csv file from local disk. Args: filepath_or_buffer: The filepath of the csv file. We only support local files for now. kwargs: Keyword arguments in pandas.read_csv """ # The ...
python
def _read(cls, filepath_or_buffer, **kwargs): """Read csv file from local disk. Args: filepath_or_buffer: The filepath of the csv file. We only support local files for now. kwargs: Keyword arguments in pandas.read_csv """ # The ...
[ "def", "_read", "(", "cls", ",", "filepath_or_buffer", ",", "*", "*", "kwargs", ")", ":", "# The intention of the inspection code is to reduce the amount of", "# communication we have to do between processes and nodes. We take a quick", "# pass over the arguments and remove those that ar...
Read csv file from local disk. Args: filepath_or_buffer: The filepath of the csv file. We only support local files for now. kwargs: Keyword arguments in pandas.read_csv
[ "Read", "csv", "file", "from", "local", "disk", ".", "Args", ":", "filepath_or_buffer", ":", "The", "filepath", "of", "the", "csv", "file", ".", "We", "only", "support", "local", "files", "for", "now", ".", "kwargs", ":", "Keyword", "arguments", "in", "p...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L483-L551
train
modin-project/modin
modin/engines/ray/generic/io.py
RayIO.read_hdf
def read_hdf(cls, path_or_buf, **kwargs): """Load a h5 file from the file path or buffer, returning a DataFrame. Args: path_or_buf: string, buffer or path object Path to the file to open, or an open :class:`pandas.HDFStore` object. kwargs: Pass into pandas.read_h...
python
def read_hdf(cls, path_or_buf, **kwargs): """Load a h5 file from the file path or buffer, returning a DataFrame. Args: path_or_buf: string, buffer or path object Path to the file to open, or an open :class:`pandas.HDFStore` object. kwargs: Pass into pandas.read_h...
[ "def", "read_hdf", "(", "cls", ",", "path_or_buf", ",", "*", "*", "kwargs", ")", ":", "if", "cls", ".", "read_hdf_remote_task", "is", "None", ":", "return", "super", "(", "RayIO", ",", "cls", ")", ".", "read_hdf", "(", "path_or_buf", ",", "*", "*", "...
Load a h5 file from the file path or buffer, returning a DataFrame. Args: path_or_buf: string, buffer or path object Path to the file to open, or an open :class:`pandas.HDFStore` object. kwargs: Pass into pandas.read_hdf function. Returns: DataFrame ...
[ "Load", "a", "h5", "file", "from", "the", "file", "path", "or", "buffer", "returning", "a", "DataFrame", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L565-L625
train
modin-project/modin
modin/engines/ray/generic/io.py
RayIO.read_feather
def read_feather(cls, path, columns=None, use_threads=True): """Read a pandas.DataFrame from Feather format. Ray DataFrame only supports pyarrow engine for now. Args: path: The filepath of the feather file. We only support local files for now. mu...
python
def read_feather(cls, path, columns=None, use_threads=True): """Read a pandas.DataFrame from Feather format. Ray DataFrame only supports pyarrow engine for now. Args: path: The filepath of the feather file. We only support local files for now. mu...
[ "def", "read_feather", "(", "cls", ",", "path", ",", "columns", "=", "None", ",", "use_threads", "=", "True", ")", ":", "if", "cls", ".", "read_feather_remote_task", "is", "None", ":", "return", "super", "(", "RayIO", ",", "cls", ")", ".", "read_feather"...
Read a pandas.DataFrame from Feather format. Ray DataFrame only supports pyarrow engine for now. Args: path: The filepath of the feather file. We only support local files for now. multi threading is set to True by default columns: not support...
[ "Read", "a", "pandas", ".", "DataFrame", "from", "Feather", "format", ".", "Ray", "DataFrame", "only", "supports", "pyarrow", "engine", "for", "now", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L628-L686
train
modin-project/modin
modin/engines/ray/generic/io.py
RayIO.to_sql
def to_sql(cls, qc, **kwargs): """Write records stored in a DataFrame to a SQL database. Args: qc: the query compiler of the DF that we want to run to_sql on kwargs: parameters for pandas.to_sql(**kwargs) """ # we first insert an empty DF in order to create the fu...
python
def to_sql(cls, qc, **kwargs): """Write records stored in a DataFrame to a SQL database. Args: qc: the query compiler of the DF that we want to run to_sql on kwargs: parameters for pandas.to_sql(**kwargs) """ # we first insert an empty DF in order to create the fu...
[ "def", "to_sql", "(", "cls", ",", "qc", ",", "*", "*", "kwargs", ")", ":", "# we first insert an empty DF in order to create the full table in the database", "# This also helps to validate the input against pandas", "# we would like to_sql() to complete only when all rows have been inser...
Write records stored in a DataFrame to a SQL database. Args: qc: the query compiler of the DF that we want to run to_sql on kwargs: parameters for pandas.to_sql(**kwargs)
[ "Write", "records", "stored", "in", "a", "DataFrame", "to", "a", "SQL", "database", ".", "Args", ":", "qc", ":", "the", "query", "compiler", "of", "the", "DF", "that", "we", "want", "to", "run", "to_sql", "on", "kwargs", ":", "parameters", "for", "pand...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L689-L715
train
modin-project/modin
modin/engines/ray/generic/io.py
RayIO.read_sql
def read_sql(cls, sql, con, index_col=None, **kwargs): """Reads a SQL query or database table into a DataFrame. Args: sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed or a table name. con: SQLAlchemy connectable (engine/connect...
python
def read_sql(cls, sql, con, index_col=None, **kwargs): """Reads a SQL query or database table into a DataFrame. Args: sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed or a table name. con: SQLAlchemy connectable (engine/connect...
[ "def", "read_sql", "(", "cls", ",", "sql", ",", "con", ",", "index_col", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "cls", ".", "read_sql_remote_task", "is", "None", ":", "return", "super", "(", "RayIO", ",", "cls", ")", ".", "read_sql", ...
Reads a SQL query or database table into a DataFrame. Args: sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed or a table name. con: SQLAlchemy connectable (engine/connection) or database string URI or DBAPI2 connection (...
[ "Reads", "a", "SQL", "query", "or", "database", "table", "into", "a", "DataFrame", ".", "Args", ":", "sql", ":", "string", "or", "SQLAlchemy", "Selectable", "(", "select", "or", "text", "object", ")", "SQL", "query", "to", "be", "executed", "or", "a", ...
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L718-L763
train
modin-project/modin
modin/pandas/datetimes.py
to_datetime
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 the arg to datetime format. If not Ray DataFrame, this falls ba...
python
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 the arg to datetime format. If not Ray DataFrame, this falls ba...
[ "def", "to_datetime", "(", "arg", ",", "errors", "=", "\"raise\"", ",", "dayfirst", "=", "False", ",", "yearfirst", "=", "False", ",", "utc", "=", "None", ",", "box", "=", "True", ",", "format", "=", "None", ",", "exact", "=", "True", ",", "unit", ...
Convert the arg to datetime format. If not Ray DataFrame, this falls back on pandas. Args: errors ('raise' or 'ignore'): If 'ignore', errors are silenced. Pandas blatantly ignores this argument so we will too. dayfirst (bool): Date format is passed in as day first. yearfi...
[ "Convert", "the", "arg", "to", "datetime", "format", ".", "If", "not", "Ray", "DataFrame", "this", "falls", "back", "on", "pandas", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/datetimes.py#L10-L77
train
modin-project/modin
modin/experimental/pandas/io_exp.py
read_sql
def read_sql( sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, columns=None, chunksize=None, partition_column=None, lower_bound=None, upper_bound=None, max_sessions=None, ): """ Read SQL query or database table into a DataFrame. Args: ...
python
def read_sql( sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, columns=None, chunksize=None, partition_column=None, lower_bound=None, upper_bound=None, max_sessions=None, ): """ Read SQL query or database table into a DataFrame. Args: ...
[ "def", "read_sql", "(", "sql", ",", "con", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "params", "=", "None", ",", "parse_dates", "=", "None", ",", "columns", "=", "None", ",", "chunksize", "=", "None", ",", "partition_column", ...
Read SQL query or database table into a DataFrame. Args: sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed or a table name. con: SQLAlchemy connectable (engine/connection) or database string URI or DBAPI2 connection (fallback mode) index_col: Column(s) to...
[ "Read", "SQL", "query", "or", "database", "table", "into", "a", "DataFrame", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/experimental/pandas/io_exp.py#L7-L53
train
modin-project/modin
modin/engines/ray/generic/frame/partition_manager.py
RayFrameManager.block_lengths
def block_lengths(self): """Gets the lengths of the blocks. Note: This works with the property structure `_lengths_cache` to avoid having to recompute these values each time they are needed. """ if self._lengths_cache is None: try: # The first col...
python
def block_lengths(self): """Gets the lengths of the blocks. Note: This works with the property structure `_lengths_cache` to avoid having to recompute these values each time they are needed. """ if self._lengths_cache is None: try: # The first col...
[ "def", "block_lengths", "(", "self", ")", ":", "if", "self", ".", "_lengths_cache", "is", "None", ":", "try", ":", "# The first column will have the correct lengths. We have an", "# invariant that requires that all blocks be the same length in a", "# row of blocks.", "self", "....
Gets the lengths of the blocks. Note: This works with the property structure `_lengths_cache` to avoid having to recompute these values each time they are needed.
[ "Gets", "the", "lengths", "of", "the", "blocks", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/frame/partition_manager.py#L24-L42
train
modin-project/modin
modin/engines/ray/generic/frame/partition_manager.py
RayFrameManager.block_widths
def block_widths(self): """Gets the widths of the blocks. Note: This works with the property structure `_widths_cache` to avoid having to recompute these values each time they are needed. """ if self._widths_cache is None: try: # The first column ...
python
def block_widths(self): """Gets the widths of the blocks. Note: This works with the property structure `_widths_cache` to avoid having to recompute these values each time they are needed. """ if self._widths_cache is None: try: # The first column ...
[ "def", "block_widths", "(", "self", ")", ":", "if", "self", ".", "_widths_cache", "is", "None", ":", "try", ":", "# The first column will have the correct lengths. We have an", "# invariant that requires that all blocks be the same width in a", "# column of blocks.", "self", "....
Gets the widths of the blocks. Note: This works with the property structure `_widths_cache` to avoid having to recompute these values each time they are needed.
[ "Gets", "the", "widths", "of", "the", "blocks", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/frame/partition_manager.py#L45-L63
train
modin-project/modin
modin/engines/ray/pandas_on_ray/frame/partition.py
deploy_ray_func
def deploy_ray_func(func, partition, kwargs): # pragma: no cover """Deploy a function to a partition in Ray. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: func: The function to apply. partition: The partition to apply the function to. kwargs: A dict...
python
def deploy_ray_func(func, partition, kwargs): # pragma: no cover """Deploy a function to a partition in Ray. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: func: The function to apply. partition: The partition to apply the function to. kwargs: A dict...
[ "def", "deploy_ray_func", "(", "func", ",", "partition", ",", "kwargs", ")", ":", "# pragma: no cover", "try", ":", "return", "func", "(", "partition", ",", "*", "*", "kwargs", ")", "# Sometimes Arrow forces us to make a copy of an object before we operate", "# on it. W...
Deploy a function to a partition in Ray. Note: Ray functions are not detected by codecov (thus pragma: no cover) Args: func: The function to apply. partition: The partition to apply the function to. kwargs: A dictionary of keyword arguments for the function. Returns: The r...
[ "Deploy", "a", "function", "to", "a", "partition", "in", "Ray", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/frame/partition.py#L124-L143
train
modin-project/modin
modin/engines/ray/pandas_on_ray/frame/partition.py
PandasOnRayFramePartition.get
def get(self): """Gets the object out of the plasma store. Returns: The object from the plasma store. """ if len(self.call_queue): return self.apply(lambda x: x).get() try: return ray.get(self.oid) except RayTaskError as e: ...
python
def get(self): """Gets the object out of the plasma store. Returns: The object from the plasma store. """ if len(self.call_queue): return self.apply(lambda x: x).get() try: return ray.get(self.oid) except RayTaskError as e: ...
[ "def", "get", "(", "self", ")", ":", "if", "len", "(", "self", ".", "call_queue", ")", ":", "return", "self", ".", "apply", "(", "lambda", "x", ":", "x", ")", ".", "get", "(", ")", "try", ":", "return", "ray", ".", "get", "(", "self", ".", "o...
Gets the object out of the plasma store. Returns: The object from the plasma store.
[ "Gets", "the", "object", "out", "of", "the", "plasma", "store", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/frame/partition.py#L21-L32
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager.block_lengths
def block_lengths(self): """Gets the lengths of the blocks. Note: This works with the property structure `_lengths_cache` to avoid having to recompute these values each time they are needed. """ if self._lengths_cache is None: # The first column will have the cor...
python
def block_lengths(self): """Gets the lengths of the blocks. Note: This works with the property structure `_lengths_cache` to avoid having to recompute these values each time they are needed. """ if self._lengths_cache is None: # The first column will have the cor...
[ "def", "block_lengths", "(", "self", ")", ":", "if", "self", ".", "_lengths_cache", "is", "None", ":", "# The first column will have the correct lengths. We have an", "# invariant that requires that all blocks be the same length in a", "# row of blocks.", "self", ".", "_lengths_c...
Gets the lengths of the blocks. Note: This works with the property structure `_lengths_cache` to avoid having to recompute these values each time they are needed.
[ "Gets", "the", "lengths", "of", "the", "blocks", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L132-L147
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager.block_widths
def block_widths(self): """Gets the widths of the blocks. Note: This works with the property structure `_widths_cache` to avoid having to recompute these values each time they are needed. """ if self._widths_cache is None: # The first column will have the correct...
python
def block_widths(self): """Gets the widths of the blocks. Note: This works with the property structure `_widths_cache` to avoid having to recompute these values each time they are needed. """ if self._widths_cache is None: # The first column will have the correct...
[ "def", "block_widths", "(", "self", ")", ":", "if", "self", ".", "_widths_cache", "is", "None", ":", "# The first column will have the correct lengths. We have an", "# invariant that requires that all blocks be the same width in a", "# column of blocks.", "self", ".", "_widths_ca...
Gets the widths of the blocks. Note: This works with the property structure `_widths_cache` to avoid having to recompute these values each time they are needed.
[ "Gets", "the", "widths", "of", "the", "blocks", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L153-L168
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager.map_across_blocks
def map_across_blocks(self, map_func): """Applies `map_func` to every partition. Args: map_func: The function to apply. Returns: A new BaseFrameManager object, the type of object that called this. """ preprocessed_map_func = self.preprocess_func(map_func...
python
def map_across_blocks(self, map_func): """Applies `map_func` to every partition. Args: map_func: The function to apply. Returns: A new BaseFrameManager object, the type of object that called this. """ preprocessed_map_func = self.preprocess_func(map_func...
[ "def", "map_across_blocks", "(", "self", ",", "map_func", ")", ":", "preprocessed_map_func", "=", "self", ".", "preprocess_func", "(", "map_func", ")", "new_partitions", "=", "np", ".", "array", "(", "[", "[", "part", ".", "apply", "(", "preprocessed_map_func"...
Applies `map_func` to every partition. Args: map_func: The function to apply. Returns: A new BaseFrameManager object, the type of object that called this.
[ "Applies", "map_func", "to", "every", "partition", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L200-L216
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager.copartition_datasets
def copartition_datasets(self, axis, other, left_func, right_func): """Copartition two BlockPartitions objects. Args: axis: The axis to copartition. other: The other BlockPartitions object to copartition with. left_func: The function to apply to left. If None, just u...
python
def copartition_datasets(self, axis, other, left_func, right_func): """Copartition two BlockPartitions objects. Args: axis: The axis to copartition. other: The other BlockPartitions object to copartition with. left_func: The function to apply to left. If None, just u...
[ "def", "copartition_datasets", "(", "self", ",", "axis", ",", "other", ",", "left_func", ",", "right_func", ")", ":", "if", "left_func", "is", "None", ":", "new_self", "=", "self", "else", ":", "new_self", "=", "self", ".", "map_across_full_axis", "(", "ax...
Copartition two BlockPartitions objects. Args: axis: The axis to copartition. other: The other BlockPartitions object to copartition with. left_func: The function to apply to left. If None, just use the dimension of self (based on axis). right_fun...
[ "Copartition", "two", "BlockPartitions", "objects", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L231-L275
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager.map_across_full_axis
def map_across_full_axis(self, axis, map_func): """Applies `map_func` to every partition. Note: This method should be used in the case that `map_func` relies on some global information about the axis. Args: axis: The axis to perform the map across (0 - index, 1 - column...
python
def map_across_full_axis(self, axis, map_func): """Applies `map_func` to every partition. Note: This method should be used in the case that `map_func` relies on some global information about the axis. Args: axis: The axis to perform the map across (0 - index, 1 - column...
[ "def", "map_across_full_axis", "(", "self", ",", "axis", ",", "map_func", ")", ":", "# Since we are already splitting the DataFrame back up after an", "# operation, we will just use this time to compute the number of", "# partitions as best we can right now.", "num_splits", "=", "self"...
Applies `map_func` to every partition. Note: This method should be used in the case that `map_func` relies on some global information about the axis. Args: axis: The axis to perform the map across (0 - index, 1 - columns). map_func: The function to apply. R...
[ "Applies", "map_func", "to", "every", "partition", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L277-L313
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager.take
def take(self, axis, n): """Take the first (or last) n rows or columns from the blocks Note: Axis = 0 will be equivalent to `head` or `tail` Axis = 1 will be equivalent to `front` or `back` Args: axis: The axis to extract (0 for extracting rows, 1 for extracting colum...
python
def take(self, axis, n): """Take the first (or last) n rows or columns from the blocks Note: Axis = 0 will be equivalent to `head` or `tail` Axis = 1 will be equivalent to `front` or `back` Args: axis: The axis to extract (0 for extracting rows, 1 for extracting colum...
[ "def", "take", "(", "self", ",", "axis", ",", "n", ")", ":", "# These are the partitions that we will extract over", "if", "not", "axis", ":", "partitions", "=", "self", ".", "partitions", "bin_lengths", "=", "self", ".", "block_lengths", "else", ":", "partition...
Take the first (or last) n rows or columns from the blocks Note: Axis = 0 will be equivalent to `head` or `tail` Axis = 1 will be equivalent to `front` or `back` Args: axis: The axis to extract (0 for extracting rows, 1 for extracting columns) n: The number of row...
[ "Take", "the", "first", "(", "or", "last", ")", "n", "rows", "or", "columns", "from", "the", "blocks" ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L315-L396
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager.concat
def concat(self, axis, other_blocks): """Concatenate the blocks with another set of blocks. Note: Assumes that the blocks are already the same shape on the dimension being concatenated. A ValueError will be thrown if this condition is not met. Args: axis: Th...
python
def concat(self, axis, other_blocks): """Concatenate the blocks with another set of blocks. Note: Assumes that the blocks are already the same shape on the dimension being concatenated. A ValueError will be thrown if this condition is not met. Args: axis: Th...
[ "def", "concat", "(", "self", ",", "axis", ",", "other_blocks", ")", ":", "if", "type", "(", "other_blocks", ")", "is", "list", ":", "other_blocks", "=", "[", "blocks", ".", "partitions", "for", "blocks", "in", "other_blocks", "]", "return", "self", ".",...
Concatenate the blocks with another set of blocks. Note: Assumes that the blocks are already the same shape on the dimension being concatenated. A ValueError will be thrown if this condition is not met. Args: axis: The axis to concatenate to. other_block...
[ "Concatenate", "the", "blocks", "with", "another", "set", "of", "blocks", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L398-L421
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager.to_pandas
def to_pandas(self, is_transposed=False): """Convert this object into a Pandas DataFrame from the partitions. Args: is_transposed: A flag for telling this object that the external representation is transposed, but not the internal. Returns: A Pandas Data...
python
def to_pandas(self, is_transposed=False): """Convert this object into a Pandas DataFrame from the partitions. Args: is_transposed: A flag for telling this object that the external representation is transposed, but not the internal. Returns: A Pandas Data...
[ "def", "to_pandas", "(", "self", ",", "is_transposed", "=", "False", ")", ":", "# In the case this is transposed, it is easier to just temporarily", "# transpose back then transpose after the conversion. The performance", "# is the same as if we individually transposed the blocks and", "# ...
Convert this object into a Pandas DataFrame from the partitions. Args: is_transposed: A flag for telling this object that the external representation is transposed, but not the internal. Returns: A Pandas DataFrame
[ "Convert", "this", "object", "into", "a", "Pandas", "DataFrame", "from", "the", "partitions", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L439-L481
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager.get_indices
def get_indices(self, axis=0, index_func=None, old_blocks=None): """This gets the internal indices stored in the partitions. Note: These are the global indices of the object. This is mostly useful when you have deleted rows/columns internally, but do not know which ones were del...
python
def get_indices(self, axis=0, index_func=None, old_blocks=None): """This gets the internal indices stored in the partitions. Note: These are the global indices of the object. This is mostly useful when you have deleted rows/columns internally, but do not know which ones were del...
[ "def", "get_indices", "(", "self", ",", "axis", "=", "0", ",", "index_func", "=", "None", ",", "old_blocks", "=", "None", ")", ":", "ErrorMessage", ".", "catch_bugs_and_request_email", "(", "not", "callable", "(", "index_func", ")", ")", "func", "=", "self...
This gets the internal indices stored in the partitions. Note: These are the global indices of the object. This is mostly useful when you have deleted rows/columns internally, but do not know which ones were deleted. Args: axis: This axis to extract the labels. (0 -...
[ "This", "gets", "the", "internal", "indices", "stored", "in", "the", "partitions", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L503-L566
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager._get_blocks_containing_index
def _get_blocks_containing_index(self, axis, index): """Convert a global index to a block index and local index. Note: This method is primarily used to convert a global index into a partition index (along the axis provided) and local index (useful for `iloc` or similar operation...
python
def _get_blocks_containing_index(self, axis, index): """Convert a global index to a block index and local index. Note: This method is primarily used to convert a global index into a partition index (along the axis provided) and local index (useful for `iloc` or similar operation...
[ "def", "_get_blocks_containing_index", "(", "self", ",", "axis", ",", "index", ")", ":", "if", "not", "axis", ":", "ErrorMessage", ".", "catch_bugs_and_request_email", "(", "index", ">", "sum", "(", "self", ".", "block_widths", ")", ")", "cumulative_column_width...
Convert a global index to a block index and local index. Note: This method is primarily used to convert a global index into a partition index (along the axis provided) and local index (useful for `iloc` or similar operations. Args: axis: The axis along which to get ...
[ "Convert", "a", "global", "index", "to", "a", "block", "index", "and", "local", "index", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L580-L618
train
modin-project/modin
modin/engines/base/frame/partition_manager.py
BaseFrameManager._get_dict_of_block_index
def _get_dict_of_block_index(self, axis, indices, ordered=False): """Convert indices to a dict of block index to internal index mapping. Note: See `_get_blocks_containing_index` for primary usage. This method accepts a list of indices rather than just a single value, and uses `_...
python
def _get_dict_of_block_index(self, axis, indices, ordered=False): """Convert indices to a dict of block index to internal index mapping. Note: See `_get_blocks_containing_index` for primary usage. This method accepts a list of indices rather than just a single value, and uses `_...
[ "def", "_get_dict_of_block_index", "(", "self", ",", "axis", ",", "indices", ",", "ordered", "=", "False", ")", ":", "# Get the internal index and create a dictionary so we only have to", "# travel to each partition once.", "all_partitions_and_idx", "=", "[", "self", ".", "...
Convert indices to a dict of block index to internal index mapping. Note: See `_get_blocks_containing_index` for primary usage. This method accepts a list of indices rather than just a single value, and uses `_get_blocks_containing_index`. Args: axis: The axis along...
[ "Convert", "indices", "to", "a", "dict", "of", "block", "index", "to", "internal", "index", "mapping", "." ]
5b77d242596560c646b8405340c9ce64acb183cb
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L620-L668
train