partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
BasePandasDataset.le
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...
modin/pandas/base.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1435-L1446
[ "def", "le", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"le\"", ",", "other", ",", "axis", "=", "axis", ",", "level", "=", "level", ")" ]
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.lt
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...
modin/pandas/base.py
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): """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. ...
[ "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", "...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1448-L1459
[ "def", "lt", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"lt\"", ",", "other", ",", "axis", "=", "axis", ",", "level", "=", "level", ")" ]
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.mean
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)
modin/pandas/base.py
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): """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...
[ "Computes", "mean", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "the", "mean", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", "otherwise", ".",...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1522-L1544
[ "def", "mean", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "numeric_only", "=", "None", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.median
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)
modin/pandas/base.py
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): """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 ...
[ "Computes", "median", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "the", "median", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", "otherwise", ...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1546-L1567
[ "def", "median", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "numeric_only", "=", "None", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if"...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.memory_usage
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...
modin/pandas/base.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1569-L1586
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.min
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.
modin/pandas/base.py
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): """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...
[ "Perform", "min", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "the", "min", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", "otherwise", ".", ...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1588-L1608
[ "def", "min", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "numeric_only", "=", "None", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.mod
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...
modin/pandas/base.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1610-L1624
[ "def", "mod", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"mod\"", ",", "other", ",", "axis", "=", "axis", ",", "level", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.mode
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.
modin/pandas/base.py
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): """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", ...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1626-L1641
[ "def", "mode", "(", "self", ",", "axis", "=", "0", ",", "numeric_only", "=", "False", ",", "dropna", "=", "True", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "return", "self", ".", "__constructor__", "(", "query_compiler", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.mul
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...
modin/pandas/base.py
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): """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...
[ "Multiplies", "this", "DataFrame", "against", "another", "DataFrame", "/", "Series", "/", "scalar", ".", "Args", ":", "other", ":", "The", "object", "to", "use", "to", "apply", "the", "multiply", "against", "this", ".", "axis", ":", "The", "axis", "to", ...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1643-L1657
[ "def", "mul", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"mul\"", ",", "other", ",", "axis", "=", "axis", ",", "level", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.ne
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...
modin/pandas/base.py
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): """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. ...
[ "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", "...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1661-L1672
[ "def", "ne", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"ne\"", ",", "other", ",", "axis", "=", "axis", ",", "level", "=", "level", ")" ]
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.nunique
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
modin/pandas/base.py
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): """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", ...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1685-L1699
[ "def", "nunique", "(", "self", ",", "axis", "=", "0", ",", "dropna", "=", "True", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", "axis", "is", "not", "None", "else", "0", "return", "self", ".", "_reduce_dimension", "(...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.pow
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...
modin/pandas/base.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1738-L1752
[ "def", "pow", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"pow\"", ",", "other", ",", "axis", "=", "axis", ",", "level", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.prod
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...
modin/pandas/base.py
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 ): """Return the product of the values for the requested axis Args: axis : {index (0), columns (1)} skipna : bool...
[ "Return", "the", "product", "of", "the", "values", "for", "the", "requested", "axis", "Args", ":", "axis", ":", "{", "index", "(", "0", ")", "columns", "(", "1", ")", "}", "skipna", ":", "boolean", "default", "True", "level", ":", "int", "or", "level...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1754-L1786
[ "def", "prod", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "numeric_only", "=", "None", ",", "min_count", "=", "0", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_numbe...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.quantile
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',...
modin/pandas/base.py
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"): """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, ...
[ "Return", "values", "at", "the", "given", "quantile", "over", "requested", "axis", "a", "la", "numpy", ".", "percentile", ".", "Args", ":", "q", "(", "float", ")", ":", "0", "<", "=", "q", "<", "=", "1", "the", "quantile", "(", "s", ")", "to", "c...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1791-L1862
[ "def", "quantile", "(", "self", ",", "q", "=", "0.5", ",", "axis", "=", "0", ",", "numeric_only", "=", "True", ",", "interpolation", "=", "\"linear\"", ")", ":", "axis", "=", "self", ".", "_get_axis_number", "(", "axis", ")", "if", "axis", "is", "not...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.rank
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'...
modin/pandas/base.py
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, ): """ Compute numerical data ranks (1 through n) along axis. Equal values are assigned a rank that is the [method] of ...
[ "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", ":", ...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L1864-L1904
[ "def", "rank", "(", "self", ",", "axis", "=", "0", ",", "method", "=", "\"average\"", ",", "numeric_only", "=", "None", ",", "na_option", "=", "\"keep\"", ",", "ascending", "=", "True", ",", "pct", "=", "False", ",", ")", ":", "axis", "=", "self", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.reset_index
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...
modin/pandas/base.py
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="" ): """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 ...
[ "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", ...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2114-L2159
[ "def", "reset_index", "(", "self", ",", "level", "=", "None", ",", "drop", "=", "False", ",", "inplace", "=", "False", ",", "col_level", "=", "0", ",", "col_fill", "=", "\"\"", ")", ":", "inplace", "=", "validate_bool_kwarg", "(", "inplace", ",", "\"in...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.rmod
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...
modin/pandas/base.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2166-L2180
[ "def", "rmod", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"rmod\"", ",", "other", ",", "axis", "=", "axis", ",", "level"...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.round
Round each element in the DataFrame. Args: decimals: The number of decimals to round to. Returns: A new DataFrame.
modin/pandas/base.py
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): """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...
[ "Round", "each", "element", "in", "the", "DataFrame", ".", "Args", ":", "decimals", ":", "The", "number", "of", "decimals", "to", "round", "to", ".", "Returns", ":", "A", "new", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2205-L2216
[ "def", "round", "(", "self", ",", "decimals", "=", "0", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", "self", ".", "__constructor__", "(", "query_compiler", "=", "self", ".", "_query_compiler", ".", "round", "(", "decimals", "=", "deci...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.rpow
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...
modin/pandas/base.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2218-L2232
[ "def", "rpow", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"rpow\"", ",", "other", ",", "axis", "=", "axis", ",", "level"...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.rsub
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. ...
modin/pandas/base.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2234-L2248
[ "def", "rsub", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"rsub\"", ",", "other", ",", "axis", "=", "axis", ",", "level"...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.rtruediv
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...
modin/pandas/base.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2250-L2264
[ "def", "rtruediv", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"rtruediv\"", ",", "other", ",", "axis", "=", "axis", ",", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.sample
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...
modin/pandas/base.py
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, ): """Returns a random sample of items from an axis of object. Args: n: Number of items from axis to return. Cannot be used...
[ "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",...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2268-L2410
[ "def", "sample", "(", "self", ",", "n", "=", "None", ",", "frac", "=", "None", ",", "replace", "=", "False", ",", "weights", "=", "None", ",", "random_state", "=", "None", ",", "axis", "=", "None", ",", ")", ":", "axis", "=", "self", ".", "_get_a...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.set_axis
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...
modin/pandas/base.py
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): """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. ...
[ "Assign", "desired", "index", "to", "given", "axis", ".", "Args", ":", "labels", "(", "pandas", ".", "Index", "or", "list", "-", "like", ")", ":", "The", "Index", "to", "assign", ".", "axis", "(", "string", "or", "int", ")", ":", "The", "axis", "to...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2428-L2463
[ "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 ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.sort_index
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...
modin/pandas/base.py
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, by=None, ): """Sort a DataFrame by one of the indices (columns or index). Args: ...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2504-L2559
[ "def", "sort_index", "(", "self", ",", "axis", "=", "0", ",", "level", "=", "None", ",", "ascending", "=", "True", ",", "inplace", "=", "False", ",", "kind", "=", "\"quicksort\"", ",", "na_position", "=", "\"last\"", ",", "sort_remaining", "=", "True", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.sort_values
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. ...
modin/pandas/base.py
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", ): """Sorts by a column/row or list of columns/rows. Args: by: A list of labels for the axis to sort over. ...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2561-L2615
[ "def", "sort_values", "(", "self", ",", "by", ",", "axis", "=", "0", ",", "ascending", "=", "True", ",", "inplace", "=", "False", ",", "kind", "=", "\"quicksort\"", ",", "na_position", "=", "\"last\"", ",", ")", ":", "axis", "=", "self", ".", "_get_a...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.sub
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. ...
modin/pandas/base.py
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): """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 ...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2644-L2658
[ "def", "sub", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"sub\"", ",", "other", ",", "axis", "=", "axis", ",", "level", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.to_numpy
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.
modin/pandas/base.py
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): """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...
[ "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",...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L2901-L2912
[ "def", "to_numpy", "(", "self", ",", "dtype", "=", "None", ",", "copy", "=", "False", ")", ":", "return", "self", ".", "_default_to_pandas", "(", "\"to_numpy\"", ",", "dtype", "=", "dtype", ",", "copy", "=", "copy", ")" ]
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.truediv
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. ...
modin/pandas/base.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L3012-L3026
[ "def", "truediv", "(", "self", ",", "other", ",", "axis", "=", "\"columns\"", ",", "level", "=", "None", ",", "fill_value", "=", "None", ")", ":", "return", "self", ".", "_binary_op", "(", "\"truediv\"", ",", "other", ",", "axis", "=", "axis", ",", "...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.var
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.
modin/pandas/base.py
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 ): """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 (...
[ "Computes", "variance", "across", "the", "DataFrame", ".", "Args", ":", "axis", "(", "int", ")", ":", "The", "axis", "to", "take", "the", "variance", "on", ".", "skipna", "(", "bool", ")", ":", "True", "to", "skip", "NA", "values", "false", "otherwise"...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L3068-L3093
[ "def", "var", "(", "self", ",", "axis", "=", "None", ",", "skipna", "=", "None", ",", "level", "=", "None", ",", "ddof", "=", "1", ",", "numeric_only", "=", "None", ",", "*", "*", "kwargs", ")", ":", "axis", "=", "self", ".", "_get_axis_number", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BasePandasDataset.size
Get the number of elements in the DataFrame. Returns: The number of elements in the DataFrame.
modin/pandas/base.py
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): """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)
[ "Get", "the", "number", "of", "elements", "in", "the", "DataFrame", ".", "Returns", ":", "The", "number", "of", "elements", "in", "the", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/base.py#L3238-L3244
[ "def", "size", "(", "self", ")", ":", "return", "len", "(", "self", ".", "_query_compiler", ".", "index", ")", "*", "len", "(", "self", ".", "_query_compiler", ".", "columns", ")" ]
5b77d242596560c646b8405340c9ce64acb183cb
train
PandasOnPythonFramePartition.get
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`.
modin/engines/python/pandas_on_python/frame/partition.py
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): """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: ...
[ "Flushes", "the", "call_queue", "and", "returns", "the", "data", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/python/pandas_on_python/frame/partition.py#L23-L34
[ "def", "get", "(", "self", ")", ":", "if", "self", ".", "call_queue", ":", "return", "self", ".", "apply", "(", "lambda", "df", ":", "df", ")", ".", "data", "else", ":", "return", "self", ".", "data", ".", "copy", "(", ")" ]
5b77d242596560c646b8405340c9ce64acb183cb
train
PandasOnPythonFramePartition.apply
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...
modin/engines/python/pandas_on_python/frame/partition.py
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): """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...
[ "Apply", "some", "callable", "function", "to", "the", "data", "in", "this", "partition", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/python/pandas_on_python/frame/partition.py#L36-L64
[ "def", "apply", "(", "self", ",", "func", ",", "*", "*", "kwargs", ")", ":", "self", ".", "call_queue", ".", "append", "(", "(", "func", ",", "kwargs", ")", ")", "def", "call_queue_closure", "(", "data", ",", "call_queues", ")", ":", "result", "=", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
DaskFramePartition.apply
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...
modin/engines/dask/pandas_on_dask_delayed/frame/partition.py
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): """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...
[ "Apply", "some", "callable", "function", "to", "the", "data", "in", "this", "partition", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/dask/pandas_on_dask_delayed/frame/partition.py#L29-L48
[ "def", "apply", "(", "self", ",", "func", ",", "*", "*", "kwargs", ")", ":", "import", "dask", "# applies the func lazily", "delayed_call", "=", "self", ".", "delayed_call", "self", ".", "delayed_call", "=", "self", ".", "dask_obj", "return", "self", ".", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
DaskFramePartition.add_to_apply_calls
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
modin/engines/dask/pandas_on_dask_delayed/frame/partition.py
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): """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...
[ "Add", "the", "function", "to", "the", "apply", "function", "call", "stack", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/dask/pandas_on_dask_delayed/frame/partition.py#L50-L59
[ "def", "add_to_apply_calls", "(", "self", ",", "func", ",", "*", "*", "kwargs", ")", ":", "import", "dask", "self", ".", "delayed_call", "=", "dask", ".", "delayed", "(", "func", ")", "(", "self", ".", "delayed_call", ",", "*", "*", "kwargs", ")", "r...
5b77d242596560c646b8405340c9ce64acb183cb
train
_read_csv_with_offset_pyarrow_on_ray
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...
modin/experimental/engines/pyarrow_on_ray/io.py
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 """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....
[ "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", ":", ...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/experimental/engines/pyarrow_on_ray/io.py#L23-L54
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
compute_chunksize
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:...
modin/data_management/utils.py
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): """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...
[ "Computes", "the", "number", "of", "rows", "and", "/", "or", "columns", "to", "include", "in", "each", "partition", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/data_management/utils.py#L24-L52
[ "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", "(", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
_get_nan_block_id
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...
modin/data_management/utils.py
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): """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...
[ "A", "memory", "efficient", "way", "to", "get", "a", "block", "of", "NaNs", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/data_management/utils.py#L55-L75
[ "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", "="...
5b77d242596560c646b8405340c9ce64acb183cb
train
split_result_of_axis_func_pandas
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...
modin/data_management/utils.py
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): """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 ...
[ "Split", "the", "Pandas", "result", "evenly", "based", "on", "the", "provided", "number", "of", "splits", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/data_management/utils.py#L78-L111
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
_parse_tuple
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
modin/pandas/indexing.py
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): """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: ...
[ "Unpack", "the", "user", "input", "for", "getitem", "and", "setitem", "and", "compute", "ndim" ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L77-L101
[ "def", "_parse_tuple", "(", "tup", ")", ":", "row_loc", ",", "col_loc", "=", "slice", "(", "None", ")", ",", "slice", "(", "None", ")", "if", "is_tuple", "(", "tup", ")", ":", "row_loc", "=", "tup", "[", "0", "]", "if", "len", "(", "tup", ")", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
_is_enlargement
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 !
modin/pandas/indexing.py
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): """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...
[ "Determine", "if", "a", "locator", "will", "enlarge", "the", "global", "index", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L104-L120
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
_compute_ndim
Compute the ndim of result from locators
modin/pandas/indexing.py
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): """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
[ "Compute", "the", "ndim", "of", "result", "from", "locators" ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L127-L140
[ "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", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
_LocationIndexerBase._broadcast_item
Use numpy to broadcast or reshape item. Notes: - Numpy is memory efficient, there shouldn't be performance issue.
modin/pandas/indexing.py
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): """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 ...
[ "Use", "numpy", "to", "broadcast", "or", "reshape", "item", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L187-L221
[ "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", "(", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
_LocationIndexerBase._write_items
Perform remote write and replace blocks.
modin/pandas/indexing.py
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): """Perform remote write and replace blocks. """ self.qc.write_items(row_lookup, col_lookup, item)
[ "Perform", "remote", "write", "and", "replace", "blocks", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L223-L226
[ "def", "_write_items", "(", "self", ",", "row_lookup", ",", "col_lookup", ",", "item", ")", ":", "self", ".", "qc", ".", "write_items", "(", "row_lookup", ",", "col_lookup", ",", "item", ")" ]
5b77d242596560c646b8405340c9ce64acb183cb
train
_LocIndexer._handle_enlargement
Handle Enlargement (if there is one). Returns: None
modin/pandas/indexing.py
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): """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...
[ "Handle", "Enlargement", "(", "if", "there", "is", "one", ")", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L279-L292
[ "def", "_handle_enlargement", "(", "self", ",", "row_loc", ",", "col_loc", ")", ":", "if", "_is_enlargement", "(", "row_loc", ",", "self", ".", "qc", ".", "index", ")", "or", "_is_enlargement", "(", "col_loc", ",", "self", ".", "qc", ".", "columns", ")",...
5b77d242596560c646b8405340c9ce64acb183cb
train
_LocIndexer._compute_enlarge_labels
Helper for _enlarge_axis, compute common labels and extra labels. Returns: nan_labels: The labels needs to be added
modin/pandas/indexing.py
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): """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...
[ "Helper", "for", "_enlarge_axis", "compute", "common", "labels", "and", "extra", "labels", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/indexing.py#L294-L315
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
_split_result_for_readers
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.
modin/engines/ray/pandas_on_ray/io.py
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 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...
[ "Splits", "the", "DataFrame", "read", "into", "smaller", "DataFrames", "and", "handles", "all", "edge", "cases", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L18-L32
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
_read_parquet_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...
modin/engines/ray/pandas_on_ray/io.py
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 """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...
[ "Use", "a", "Ray", "task", "to", "read", "columns", "from", "Parquet", "into", "a", "Pandas", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L36-L56
[ "def", "_read_parquet_columns", "(", "path", ",", "columns", ",", "num_splits", ",", "kwargs", ")", ":", "# pragma: no cover", "import", "pyarrow", ".", "parquet", "as", "pq", "df", "=", "pq", ".", "read_pandas", "(", "path", ",", "columns", "=", "columns", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
_read_csv_with_offset_pandas_on_ray
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...
modin/engines/ray/pandas_on_ray/io.py
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 """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...
[ "Use", "a", "Ray", "task", "to", "read", "a", "chunk", "of", "a", "CSV", "into", "a", "Pandas", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L60-L96
[ "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", "=", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
_read_hdf_columns
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...
modin/engines/ray/pandas_on_ray/io.py
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 """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 ...
[ "Use", "a", "Ray", "task", "to", "read", "columns", "from", "HDF5", "into", "a", "Pandas", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L100-L119
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
_read_feather_columns
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...
modin/engines/ray/pandas_on_ray/io.py
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 """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...
[ "Use", "a", "Ray", "task", "to", "read", "columns", "from", "Feather", "into", "a", "Pandas", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L123-L143
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
_read_sql_with_limit_offset
Use a Ray task to read a chunk of SQL source. Note: Ray functions are not detected by codecov (thus pragma: no cover)
modin/engines/ray/pandas_on_ray/io.py
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 """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...
[ "Use", "a", "Ray", "task", "to", "read", "a", "chunk", "of", "SQL", "source", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/io.py#L147-L159
[ "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", ",", "*...
5b77d242596560c646b8405340c9ce64acb183cb
train
get_index
Get the index from the indices returned by the workers. Note: Ray functions are not detected by codecov (thus pragma: no cover)
modin/engines/ray/generic/io.py
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 """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
[ "Get", "the", "index", "from", "the", "indices", "returned", "by", "the", "workers", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L64-L70
[ "def", "get_index", "(", "index_name", ",", "*", "partition_indices", ")", ":", "# pragma: no cover", "index", "=", "partition_indices", "[", "0", "]", ".", "append", "(", "partition_indices", "[", "1", ":", "]", ")", "index", ".", "names", "=", "index_name"...
5b77d242596560c646b8405340c9ce64acb183cb
train
RayIO.read_parquet
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. ...
modin/engines/ray/generic/io.py
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): """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. ...
[ "Load", "a", "parquet", "object", "from", "the", "file", "path", "returning", "a", "DataFrame", ".", "Ray", "DataFrame", "only", "supports", "pyarrow", "engine", "for", "now", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L129-L193
[ "def", "read_parquet", "(", "cls", ",", "path", ",", "engine", ",", "columns", ",", "*", "*", "kwargs", ")", ":", "from", "pyarrow", ".", "parquet", "import", "ParquetFile", "if", "cls", ".", "read_parquet_remote_task", "is", "None", ":", "return", "super"...
5b77d242596560c646b8405340c9ce64acb183cb
train
RayIO._read_csv_from_file_pandas_on_ray
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 ...
modin/engines/ray/generic/io.py
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={}): """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_...
[ "Constructs", "a", "DataFrame", "from", "a", "CSV", "file", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L242-L357
[ "def", "_read_csv_from_file_pandas_on_ray", "(", "cls", ",", "filepath", ",", "kwargs", "=", "{", "}", ")", ":", "names", "=", "kwargs", ".", "get", "(", "\"names\"", ",", "None", ")", "index_col", "=", "kwargs", ".", "get", "(", "\"index_col\"", ",", "N...
5b77d242596560c646b8405340c9ce64acb183cb
train
RayIO._read
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
modin/engines/ray/generic/io.py
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): """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 ...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L483-L551
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
RayIO.read_hdf
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 ...
modin/engines/ray/generic/io.py
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): """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...
[ "Load", "a", "h5", "file", "from", "the", "file", "path", "or", "buffer", "returning", "a", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L565-L625
[ "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", ",", "*", "*", "...
5b77d242596560c646b8405340c9ce64acb183cb
train
RayIO.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...
modin/engines/ray/generic/io.py
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): """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...
[ "Read", "a", "pandas", ".", "DataFrame", "from", "Feather", "format", ".", "Ray", "DataFrame", "only", "supports", "pyarrow", "engine", "for", "now", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L628-L686
[ "def", "read_feather", "(", "cls", ",", "path", ",", "columns", "=", "None", ",", "use_threads", "=", "True", ")", ":", "if", "cls", ".", "read_feather_remote_task", "is", "None", ":", "return", "super", "(", "RayIO", ",", "cls", ")", ".", "read_feather"...
5b77d242596560c646b8405340c9ce64acb183cb
train
RayIO.to_sql
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)
modin/engines/ray/generic/io.py
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): """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...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L689-L715
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
RayIO.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 (...
modin/engines/ray/generic/io.py
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): """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...
[ "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", ...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/io.py#L718-L763
[ "def", "read_sql", "(", "cls", ",", "sql", ",", "con", ",", "index_col", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "cls", ".", "read_sql_remote_task", "is", "None", ":", "return", "super", "(", "RayIO", ",", "cls", ")", ".", "read_sql", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
to_datetime
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...
modin/pandas/datetimes.py
def to_datetime( arg, errors="raise", dayfirst=False, yearfirst=False, utc=None, box=True, format=None, exact=True, unit=None, infer_datetime_format=False, origin="unix", cache=False, ): """Convert 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=None, infer_datetime_format=False, origin="unix", cache=False, ): """Convert the arg to datetime format. If not Ray DataFrame, this falls ba...
[ "Convert", "the", "arg", "to", "datetime", "format", ".", "If", "not", "Ray", "DataFrame", "this", "falls", "back", "on", "pandas", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/datetimes.py#L10-L77
[ "def", "to_datetime", "(", "arg", ",", "errors", "=", "\"raise\"", ",", "dayfirst", "=", "False", ",", "yearfirst", "=", "False", ",", "utc", "=", "None", ",", "box", "=", "True", ",", "format", "=", "None", ",", "exact", "=", "True", ",", "unit", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
read_sql
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...
modin/experimental/pandas/io_exp.py
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=None, lower_bound=None, upper_bound=None, max_sessions=None, ): """ Read SQL query or database table into a DataFrame. Args: ...
[ "Read", "SQL", "query", "or", "database", "table", "into", "a", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/experimental/pandas/io_exp.py#L7-L53
[ "def", "read_sql", "(", "sql", ",", "con", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "params", "=", "None", ",", "parse_dates", "=", "None", ",", "columns", "=", "None", ",", "chunksize", "=", "None", ",", "partition_column", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
RayFrameManager.block_lengths
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.
modin/engines/ray/generic/frame/partition_manager.py
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): """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...
[ "Gets", "the", "lengths", "of", "the", "blocks", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/frame/partition_manager.py#L24-L42
[ "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", "....
5b77d242596560c646b8405340c9ce64acb183cb
train
RayFrameManager.block_widths
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.
modin/engines/ray/generic/frame/partition_manager.py
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): """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 ...
[ "Gets", "the", "widths", "of", "the", "blocks", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/generic/frame/partition_manager.py#L45-L63
[ "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", "....
5b77d242596560c646b8405340c9ce64acb183cb
train
deploy_ray_func
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...
modin/engines/ray/pandas_on_ray/frame/partition.py
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 """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...
[ "Deploy", "a", "function", "to", "a", "partition", "in", "Ray", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/frame/partition.py#L124-L143
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
PandasOnRayFramePartition.get
Gets the object out of the plasma store. Returns: The object from the plasma store.
modin/engines/ray/pandas_on_ray/frame/partition.py
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): """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: ...
[ "Gets", "the", "object", "out", "of", "the", "plasma", "store", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/ray/pandas_on_ray/frame/partition.py#L21-L32
[ "def", "get", "(", "self", ")", ":", "if", "len", "(", "self", ".", "call_queue", ")", ":", "return", "self", ".", "apply", "(", "lambda", "x", ":", "x", ")", ".", "get", "(", ")", "try", ":", "return", "ray", ".", "get", "(", "self", ".", "o...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.block_lengths
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.
modin/engines/base/frame/partition_manager.py
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): """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...
[ "Gets", "the", "lengths", "of", "the", "blocks", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L132-L147
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.block_widths
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.
modin/engines/base/frame/partition_manager.py
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): """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...
[ "Gets", "the", "widths", "of", "the", "blocks", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L153-L168
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.map_across_blocks
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.
modin/engines/base/frame/partition_manager.py
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): """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...
[ "Applies", "map_func", "to", "every", "partition", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L200-L216
[ "def", "map_across_blocks", "(", "self", ",", "map_func", ")", ":", "preprocessed_map_func", "=", "self", ".", "preprocess_func", "(", "map_func", ")", "new_partitions", "=", "np", ".", "array", "(", "[", "[", "part", ".", "apply", "(", "preprocessed_map_func"...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.copartition_datasets
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...
modin/engines/base/frame/partition_manager.py
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): """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...
[ "Copartition", "two", "BlockPartitions", "objects", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L231-L275
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.map_across_full_axis
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...
modin/engines/base/frame/partition_manager.py
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): """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...
[ "Applies", "map_func", "to", "every", "partition", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L277-L313
[ "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"...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.take
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...
modin/engines/base/frame/partition_manager.py
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): """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...
[ "Take", "the", "first", "(", "or", "last", ")", "n", "rows", "or", "columns", "from", "the", "blocks" ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L315-L396
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.concat
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...
modin/engines/base/frame/partition_manager.py
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): """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...
[ "Concatenate", "the", "blocks", "with", "another", "set", "of", "blocks", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L398-L421
[ "def", "concat", "(", "self", ",", "axis", ",", "other_blocks", ")", ":", "if", "type", "(", "other_blocks", ")", "is", "list", ":", "other_blocks", "=", "[", "blocks", ".", "partitions", "for", "blocks", "in", "other_blocks", "]", "return", "self", ".",...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.to_pandas
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
modin/engines/base/frame/partition_manager.py
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): """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...
[ "Convert", "this", "object", "into", "a", "Pandas", "DataFrame", "from", "the", "partitions", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L439-L481
[ "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", "# ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.get_indices
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 -...
modin/engines/base/frame/partition_manager.py
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): """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...
[ "This", "gets", "the", "internal", "indices", "stored", "in", "the", "partitions", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L503-L566
[ "def", "get_indices", "(", "self", ",", "axis", "=", "0", ",", "index_func", "=", "None", ",", "old_blocks", "=", "None", ")", ":", "ErrorMessage", ".", "catch_bugs_and_request_email", "(", "not", "callable", "(", "index_func", ")", ")", "func", "=", "self...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager._get_blocks_containing_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 operations. Args: axis: The axis along which to get ...
modin/engines/base/frame/partition_manager.py
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): """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...
[ "Convert", "a", "global", "index", "to", "a", "block", "index", "and", "local", "index", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L580-L618
[ "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...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager._get_dict_of_block_index
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...
modin/engines/base/frame/partition_manager.py
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): """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 `_...
[ "Convert", "indices", "to", "a", "dict", "of", "block", "index", "to", "internal", "index", "mapping", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L620-L668
[ "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", ".", "...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager._apply_func_to_list_of_partitions
Applies a function to a list of remote partitions. Note: The main use for this is to preprocess the func. Args: func: The func to apply partitions: The list of partitions Returns: A list of BaseFramePartition objects.
modin/engines/base/frame/partition_manager.py
def _apply_func_to_list_of_partitions(self, func, partitions, **kwargs): """Applies a function to a list of remote partitions. Note: The main use for this is to preprocess the func. Args: func: The func to apply partitions: The list of partitions Returns: ...
def _apply_func_to_list_of_partitions(self, func, partitions, **kwargs): """Applies a function to a list of remote partitions. Note: The main use for this is to preprocess the func. Args: func: The func to apply partitions: The list of partitions Returns: ...
[ "Applies", "a", "function", "to", "a", "list", "of", "remote", "partitions", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L670-L683
[ "def", "_apply_func_to_list_of_partitions", "(", "self", ",", "func", ",", "partitions", ",", "*", "*", "kwargs", ")", ":", "preprocessed_func", "=", "self", ".", "preprocess_func", "(", "func", ")", "return", "[", "obj", ".", "apply", "(", "preprocessed_func"...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.apply_func_to_select_indices
Applies a function to select indices. Note: Your internal function must take a kwarg `internal_indices` for this to work correctly. This prevents information leakage of the internal index to the external representation. Args: axis: The axis to apply the func over. ...
modin/engines/base/frame/partition_manager.py
def apply_func_to_select_indices(self, axis, func, indices, keep_remaining=False): """Applies a function to select indices. Note: Your internal function must take a kwarg `internal_indices` for this to work correctly. This prevents information leakage of the internal index to th...
def apply_func_to_select_indices(self, axis, func, indices, keep_remaining=False): """Applies a function to select indices. Note: Your internal function must take a kwarg `internal_indices` for this to work correctly. This prevents information leakage of the internal index to th...
[ "Applies", "a", "function", "to", "select", "indices", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L685-L803
[ "def", "apply_func_to_select_indices", "(", "self", ",", "axis", ",", "func", ",", "indices", ",", "keep_remaining", "=", "False", ")", ":", "if", "self", ".", "partitions", ".", "size", "==", "0", ":", "return", "np", ".", "array", "(", "[", "[", "]",...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.apply_func_to_select_indices_along_full_axis
Applies a function to a select subset of full columns/rows. Note: This should be used when you need to apply a function that relies on some global information for the entire column/row, but only need to apply a function to a subset. Important: For your func to operate directly ...
modin/engines/base/frame/partition_manager.py
def apply_func_to_select_indices_along_full_axis( self, axis, func, indices, keep_remaining=False ): """Applies a function to a select subset of full columns/rows. Note: This should be used when you need to apply a function that relies on some global information for the entire c...
def apply_func_to_select_indices_along_full_axis( self, axis, func, indices, keep_remaining=False ): """Applies a function to a select subset of full columns/rows. Note: This should be used when you need to apply a function that relies on some global information for the entire c...
[ "Applies", "a", "function", "to", "a", "select", "subset", "of", "full", "columns", "/", "rows", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L805-L905
[ "def", "apply_func_to_select_indices_along_full_axis", "(", "self", ",", "axis", ",", "func", ",", "indices", ",", "keep_remaining", "=", "False", ")", ":", "if", "self", ".", "partitions", ".", "size", "==", "0", ":", "return", "self", ".", "__constructor__",...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.apply_func_to_indices_both_axis
Apply a function to along both axis Important: For your func to operate directly on the indices provided, it must use `row_internal_indices, col_internal_indices` as keyword arguments.
modin/engines/base/frame/partition_manager.py
def apply_func_to_indices_both_axis( self, func, row_indices, col_indices, lazy=False, keep_remaining=True, mutate=False, item_to_distribute=None, ): """ Apply a function to along both axis Important: For your func to operate d...
def apply_func_to_indices_both_axis( self, func, row_indices, col_indices, lazy=False, keep_remaining=True, mutate=False, item_to_distribute=None, ): """ Apply a function to along both axis Important: For your func to operate d...
[ "Apply", "a", "function", "to", "along", "both", "axis" ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L907-L987
[ "def", "apply_func_to_indices_both_axis", "(", "self", ",", "func", ",", "row_indices", ",", "col_indices", ",", "lazy", "=", "False", ",", "keep_remaining", "=", "True", ",", "mutate", "=", "False", ",", "item_to_distribute", "=", "None", ",", ")", ":", "if...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.inter_data_operation
Apply a function that requires two BaseFrameManager objects. Args: axis: The axis to apply the function over (0 - rows, 1 - columns) func: The function to apply other: The other BaseFrameManager object to apply func to. Returns: A new BaseFrameManager ob...
modin/engines/base/frame/partition_manager.py
def inter_data_operation(self, axis, func, other): """Apply a function that requires two BaseFrameManager objects. Args: axis: The axis to apply the function over (0 - rows, 1 - columns) func: The function to apply other: The other BaseFrameManager object to apply fu...
def inter_data_operation(self, axis, func, other): """Apply a function that requires two BaseFrameManager objects. Args: axis: The axis to apply the function over (0 - rows, 1 - columns) func: The function to apply other: The other BaseFrameManager object to apply fu...
[ "Apply", "a", "function", "that", "requires", "two", "BaseFrameManager", "objects", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L989-L1017
[ "def", "inter_data_operation", "(", "self", ",", "axis", ",", "func", ",", "other", ")", ":", "if", "axis", ":", "partitions", "=", "self", ".", "row_partitions", "other_partitions", "=", "other", ".", "row_partitions", "else", ":", "partitions", "=", "self"...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseFrameManager.manual_shuffle
Shuffle the partitions based on the `shuffle_func`. Args: axis: The axis to shuffle across. shuffle_func: The function to apply before splitting the result. lengths: The length of each partition to split the result into. Returns: A new BaseFrameManager ...
modin/engines/base/frame/partition_manager.py
def manual_shuffle(self, axis, shuffle_func, lengths): """Shuffle the partitions based on the `shuffle_func`. Args: axis: The axis to shuffle across. shuffle_func: The function to apply before splitting the result. lengths: The length of each partition to split the r...
def manual_shuffle(self, axis, shuffle_func, lengths): """Shuffle the partitions based on the `shuffle_func`. Args: axis: The axis to shuffle across. shuffle_func: The function to apply before splitting the result. lengths: The length of each partition to split the r...
[ "Shuffle", "the", "partitions", "based", "on", "the", "shuffle_func", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/frame/partition_manager.py#L1019-L1036
[ "def", "manual_shuffle", "(", "self", ",", "axis", ",", "shuffle_func", ",", "lengths", ")", ":", "if", "axis", ":", "partitions", "=", "self", ".", "row_partitions", "else", ":", "partitions", "=", "self", ".", "column_partitions", "func", "=", "self", "....
5b77d242596560c646b8405340c9ce64acb183cb
train
read_parquet
Load a parquet object from the file path, returning a DataFrame. Args: path: The filepath of the parquet file. We only support local files for now. engine: This argument doesn't do anything for now. kwargs: Pass into parquet's read_pandas function.
modin/pandas/io.py
def read_parquet(path, engine="auto", columns=None, **kwargs): """Load a parquet object from the file path, returning a DataFrame. Args: path: The filepath of the parquet file. We only support local files for now. engine: This argument doesn't do anything for now. kwargs: ...
def read_parquet(path, engine="auto", columns=None, **kwargs): """Load a parquet object from the file path, returning a DataFrame. Args: path: The filepath of the parquet file. We only support local files for now. engine: This argument doesn't do anything for now. kwargs: ...
[ "Load", "a", "parquet", "object", "from", "the", "file", "path", "returning", "a", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/io.py#L18-L31
[ "def", "read_parquet", "(", "path", ",", "engine", "=", "\"auto\"", ",", "columns", "=", "None", ",", "*", "*", "kwargs", ")", ":", "return", "DataFrame", "(", "query_compiler", "=", "BaseFactory", ".", "read_parquet", "(", "path", "=", "path", ",", "col...
5b77d242596560c646b8405340c9ce64acb183cb
train
_make_parser_func
Creates a parser function from the given sep. Args: sep: The separator default to use for the parser. Returns: A function object.
modin/pandas/io.py
def _make_parser_func(sep): """Creates a parser function from the given sep. Args: sep: The separator default to use for the parser. Returns: A function object. """ def parser_func( filepath_or_buffer, sep=sep, delimiter=None, header="infer", ...
def _make_parser_func(sep): """Creates a parser function from the given sep. Args: sep: The separator default to use for the parser. Returns: A function object. """ def parser_func( filepath_or_buffer, sep=sep, delimiter=None, header="infer", ...
[ "Creates", "a", "parser", "function", "from", "the", "given", "sep", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/io.py#L35-L101
[ "def", "_make_parser_func", "(", "sep", ")", ":", "def", "parser_func", "(", "filepath_or_buffer", ",", "sep", "=", "sep", ",", "delimiter", "=", "None", ",", "header", "=", "\"infer\"", ",", "names", "=", "None", ",", "index_col", "=", "None", ",", "use...
5b77d242596560c646b8405340c9ce64acb183cb
train
_read
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
modin/pandas/io.py
def _read(**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 """ pd_obj = BaseFactory.read_csv(**kwargs) # This happens when...
def _read(**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 """ pd_obj = BaseFactory.read_csv(**kwargs) # This happens when...
[ "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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/io.py#L104-L120
[ "def", "_read", "(", "*", "*", "kwargs", ")", ":", "pd_obj", "=", "BaseFactory", ".", "read_csv", "(", "*", "*", "kwargs", ")", "# This happens when `read_csv` returns a TextFileReader object for iterating through", "if", "isinstance", "(", "pd_obj", ",", "pandas", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
read_sql
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...
modin/pandas/io.py
def read_sql( sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, columns=None, chunksize=None, ): """ Read SQL query or database table into a DataFrame. Args: sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed o...
def read_sql( sql, con, index_col=None, coerce_float=True, params=None, parse_dates=None, columns=None, chunksize=None, ): """ Read SQL query or database table into a DataFrame. Args: sql: string or SQLAlchemy Selectable (select or text object) SQL query to be executed o...
[ "Read", "SQL", "query", "or", "database", "table", "into", "a", "DataFrame", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/pandas/io.py#L286-L324
[ "def", "read_sql", "(", "sql", ",", "con", ",", "index_col", "=", "None", ",", "coerce_float", "=", "True", ",", "params", "=", "None", ",", "parse_dates", "=", "None", ",", "columns", "=", "None", ",", "chunksize", "=", "None", ",", ")", ":", "_", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseIO.read_parquet
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. ...
modin/engines/base/io.py
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): """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. ...
[ "Load", "a", "parquet", "object", "from", "the", "file", "path", "returning", "a", "DataFrame", ".", "Ray", "DataFrame", "only", "supports", "pyarrow", "engine", "for", "now", "." ]
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/io.py#L17-L33
[ "def", "read_parquet", "(", "cls", ",", "path", ",", "engine", ",", "columns", ",", "*", "*", "kwargs", ")", ":", "ErrorMessage", ".", "default_to_pandas", "(", "\"`read_parquet`\"", ")", "return", "cls", ".", "from_pandas", "(", "pandas", ".", "read_parquet...
5b77d242596560c646b8405340c9ce64acb183cb
train
BaseIO._read
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
modin/engines/base/io.py
def _read(cls, **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 """ pd_obj = pandas.read_csv(*...
def _read(cls, **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 """ pd_obj = 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...
modin-project/modin
python
https://github.com/modin-project/modin/blob/5b77d242596560c646b8405340c9ce64acb183cb/modin/engines/base/io.py#L143-L161
[ "def", "_read", "(", "cls", ",", "*", "*", "kwargs", ")", ":", "pd_obj", "=", "pandas", ".", "read_csv", "(", "*", "*", "kwargs", ")", "if", "isinstance", "(", "pd_obj", ",", "pandas", ".", "DataFrame", ")", ":", "return", "cls", ".", "from_pandas", ...
5b77d242596560c646b8405340c9ce64acb183cb
train
auto_select_categorical_features
Make a feature mask of categorical features in X. Features with less than 10 unique values are considered categorical. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. threshold : int Maximum number of unique values...
tpot/builtins/one_hot_encoder.py
def auto_select_categorical_features(X, threshold=10): """Make a feature mask of categorical features in X. Features with less than 10 unique values are considered categorical. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix...
def auto_select_categorical_features(X, threshold=10): """Make a feature mask of categorical features in X. Features with less than 10 unique values are considered categorical. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix...
[ "Make", "a", "feature", "mask", "of", "categorical", "features", "in", "X", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L45-L75
[ "def", "auto_select_categorical_features", "(", "X", ",", "threshold", "=", "10", ")", ":", "feature_mask", "=", "[", "]", "for", "column", "in", "range", "(", "X", ".", "shape", "[", "1", "]", ")", ":", "if", "sparse", ".", "issparse", "(", "X", ")"...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
_X_selected
Split X into selected features and other features
tpot/builtins/one_hot_encoder.py
def _X_selected(X, selected): """Split X into selected features and other features""" n_features = X.shape[1] ind = np.arange(n_features) sel = np.zeros(n_features, dtype=bool) sel[np.asarray(selected)] = True non_sel = np.logical_not(sel) n_selected = np.sum(sel) X_sel = X[:, ind[sel]] ...
def _X_selected(X, selected): """Split X into selected features and other features""" n_features = X.shape[1] ind = np.arange(n_features) sel = np.zeros(n_features, dtype=bool) sel[np.asarray(selected)] = True non_sel = np.logical_not(sel) n_selected = np.sum(sel) X_sel = X[:, ind[sel]] ...
[ "Split", "X", "into", "selected", "features", "and", "other", "features" ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L78-L88
[ "def", "_X_selected", "(", "X", ",", "selected", ")", ":", "n_features", "=", "X", ".", "shape", "[", "1", "]", "ind", "=", "np", ".", "arange", "(", "n_features", ")", "sel", "=", "np", ".", "zeros", "(", "n_features", ",", "dtype", "=", "bool", ...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
_transform_selected
Apply a transform function to portion of selected features. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. transform : callable A callable transform(X) -> X_transformed copy : boolean, optional Copy X even...
tpot/builtins/one_hot_encoder.py
def _transform_selected(X, transform, selected, copy=True): """Apply a transform function to portion of selected features. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. transform : callable A callable transform(X)...
def _transform_selected(X, transform, selected, copy=True): """Apply a transform function to portion of selected features. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. transform : callable A callable transform(X)...
[ "Apply", "a", "transform", "function", "to", "portion", "of", "selected", "features", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L91-L133
[ "def", "_transform_selected", "(", "X", ",", "transform", ",", "selected", ",", "copy", "=", "True", ")", ":", "if", "selected", "==", "\"all\"", ":", "return", "transform", "(", "X", ")", "if", "len", "(", "selected", ")", "==", "0", ":", "return", ...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
OneHotEncoder._matrix_adjust
Adjust all values in X to encode for NaNs and infinities in the data. Parameters ---------- X : array-like, shape=(n_samples, n_feature) Input array of type int. Returns ------- X : array-like, shape=(n_samples, n_feature) Input array without any...
tpot/builtins/one_hot_encoder.py
def _matrix_adjust(self, X): """Adjust all values in X to encode for NaNs and infinities in the data. Parameters ---------- X : array-like, shape=(n_samples, n_feature) Input array of type int. Returns ------- X : array-like, shape=(n_samples, n_feat...
def _matrix_adjust(self, X): """Adjust all values in X to encode for NaNs and infinities in the data. Parameters ---------- X : array-like, shape=(n_samples, n_feature) Input array of type int. Returns ------- X : array-like, shape=(n_samples, n_feat...
[ "Adjust", "all", "values", "in", "X", "to", "encode", "for", "NaNs", "and", "infinities", "in", "the", "data", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L239-L267
[ "def", "_matrix_adjust", "(", "self", ",", "X", ")", ":", "data_matrix", "=", "X", ".", "data", "if", "sparse", ".", "issparse", "(", "X", ")", "else", "X", "# Shift all values to specially encode for NAN/infinity/OTHER and 0", "# Old value New Value", "# --...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
OneHotEncoder._fit_transform
Assume X contains only categorical features. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix.
tpot/builtins/one_hot_encoder.py
def _fit_transform(self, X): """Assume X contains only categorical features. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. """ X = self._matrix_adjust(X) X = check_array( ...
def _fit_transform(self, X): """Assume X contains only categorical features. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. """ X = self._matrix_adjust(X) X = check_array( ...
[ "Assume", "X", "contains", "only", "categorical", "features", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L269-L374
[ "def", "_fit_transform", "(", "self", ",", "X", ")", ":", "X", "=", "self", ".", "_matrix_adjust", "(", "X", ")", "X", "=", "check_array", "(", "X", ",", "accept_sparse", "=", "'csc'", ",", "force_all_finite", "=", "False", ",", "dtype", "=", "int", ...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
OneHotEncoder.fit_transform
Fit OneHotEncoder to X, then transform X. Equivalent to self.fit(X).transform(X), but more convenient and more efficient. See fit for the parameters, transform for the return value. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) ...
tpot/builtins/one_hot_encoder.py
def fit_transform(self, X, y=None): """Fit OneHotEncoder to X, then transform X. Equivalent to self.fit(X).transform(X), but more convenient and more efficient. See fit for the parameters, transform for the return value. Parameters ---------- X : array-like or sparse ma...
def fit_transform(self, X, y=None): """Fit OneHotEncoder to X, then transform X. Equivalent to self.fit(X).transform(X), but more convenient and more efficient. See fit for the parameters, transform for the return value. Parameters ---------- X : array-like or sparse ma...
[ "Fit", "OneHotEncoder", "to", "X", "then", "transform", "X", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L376-L397
[ "def", "fit_transform", "(", "self", ",", "X", ",", "y", "=", "None", ")", ":", "if", "self", ".", "categorical_features", "==", "\"auto\"", ":", "self", ".", "categorical_features", "=", "auto_select_categorical_features", "(", "X", ",", "threshold", "=", "...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
OneHotEncoder._transform
Asssume X contains only categorical features. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix.
tpot/builtins/one_hot_encoder.py
def _transform(self, X): """Asssume X contains only categorical features. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. """ X = self._matrix_adjust(X) X = check_array(X, accept_spar...
def _transform(self, X): """Asssume X contains only categorical features. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. """ X = self._matrix_adjust(X) X = check_array(X, accept_spar...
[ "Asssume", "X", "contains", "only", "categorical", "features", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L399-L479
[ "def", "_transform", "(", "self", ",", "X", ")", ":", "X", "=", "self", ".", "_matrix_adjust", "(", "X", ")", "X", "=", "check_array", "(", "X", ",", "accept_sparse", "=", "'csc'", ",", "force_all_finite", "=", "False", ",", "dtype", "=", "int", ")",...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
OneHotEncoder.transform
Transform X using one-hot encoding. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. Returns ------- X_out : sparse matrix if sparse=True else a 2-d array, dtype=int Transformed in...
tpot/builtins/one_hot_encoder.py
def transform(self, X): """Transform X using one-hot encoding. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. Returns ------- X_out : sparse matrix if sparse=True else a 2-d array, d...
def transform(self, X): """Transform X using one-hot encoding. Parameters ---------- X : array-like or sparse matrix, shape=(n_samples, n_features) Dense array or sparse matrix. Returns ------- X_out : sparse matrix if sparse=True else a 2-d array, d...
[ "Transform", "X", "using", "one", "-", "hot", "encoding", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/builtins/one_hot_encoder.py#L481-L498
[ "def", "transform", "(", "self", ",", "X", ")", ":", "return", "_transform_selected", "(", "X", ",", "self", ".", "_transform", ",", "self", ".", "categorical_features", ",", "copy", "=", "True", ")" ]
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
TPOTBase.fit
Fit an optimized machine learning pipeline. Uses genetic programming to optimize a machine learning pipeline that maximizes score on the provided features and target. Performs internal k-fold cross-validaton to avoid overfitting on the provided data. The best pipeline is then trained on...
tpot/base.py
def fit(self, features, target, sample_weight=None, groups=None): """Fit an optimized machine learning pipeline. Uses genetic programming to optimize a machine learning pipeline that maximizes score on the provided features and target. Performs internal k-fold cross-validaton to avoid o...
def fit(self, features, target, sample_weight=None, groups=None): """Fit an optimized machine learning pipeline. Uses genetic programming to optimize a machine learning pipeline that maximizes score on the provided features and target. Performs internal k-fold cross-validaton to avoid o...
[ "Fit", "an", "optimized", "machine", "learning", "pipeline", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L621-L780
[ "def", "fit", "(", "self", ",", "features", ",", "target", ",", "sample_weight", "=", "None", ",", "groups", "=", "None", ")", ":", "self", ".", "_fit_init", "(", ")", "features", ",", "target", "=", "self", ".", "_check_dataset", "(", "features", ",",...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
TPOTBase._setup_memory
Setup Memory object for memory caching.
tpot/base.py
def _setup_memory(self): """Setup Memory object for memory caching. """ if self.memory: if isinstance(self.memory, str): if self.memory == "auto": # Create a temporary folder to store the transformers of the pipeline self._cache...
def _setup_memory(self): """Setup Memory object for memory caching. """ if self.memory: if isinstance(self.memory, str): if self.memory == "auto": # Create a temporary folder to store the transformers of the pipeline self._cache...
[ "Setup", "Memory", "object", "for", "memory", "caching", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L783-L809
[ "def", "_setup_memory", "(", "self", ")", ":", "if", "self", ".", "memory", ":", "if", "isinstance", "(", "self", ".", "memory", ",", "str", ")", ":", "if", "self", ".", "memory", "==", "\"auto\"", ":", "# Create a temporary folder to store the transformers of...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
TPOTBase._update_top_pipeline
Helper function to update the _optimized_pipeline field.
tpot/base.py
def _update_top_pipeline(self): """Helper function to update the _optimized_pipeline field.""" # Store the pipeline with the highest internal testing score if self._pareto_front: self._optimized_pipeline_score = -float('inf') for pipeline, pipeline_scores in zip(self._par...
def _update_top_pipeline(self): """Helper function to update the _optimized_pipeline field.""" # Store the pipeline with the highest internal testing score if self._pareto_front: self._optimized_pipeline_score = -float('inf') for pipeline, pipeline_scores in zip(self._par...
[ "Helper", "function", "to", "update", "the", "_optimized_pipeline", "field", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L819-L848
[ "def", "_update_top_pipeline", "(", "self", ")", ":", "# Store the pipeline with the highest internal testing score", "if", "self", ".", "_pareto_front", ":", "self", ".", "_optimized_pipeline_score", "=", "-", "float", "(", "'inf'", ")", "for", "pipeline", ",", "pipe...
b626271e6b5896a73fb9d7d29bebc7aa9100772e
train
TPOTBase._summary_of_best_pipeline
Print out best pipeline at the end of optimization process. Parameters ---------- features: array-like {n_samples, n_features} Feature matrix target: array-like {n_samples} List of class labels for prediction Returns ------- self: object...
tpot/base.py
def _summary_of_best_pipeline(self, features, target): """Print out best pipeline at the end of optimization process. Parameters ---------- features: array-like {n_samples, n_features} Feature matrix target: array-like {n_samples} List of class labels fo...
def _summary_of_best_pipeline(self, features, target): """Print out best pipeline at the end of optimization process. Parameters ---------- features: array-like {n_samples, n_features} Feature matrix target: array-like {n_samples} List of class labels fo...
[ "Print", "out", "best", "pipeline", "at", "the", "end", "of", "optimization", "process", "." ]
EpistasisLab/tpot
python
https://github.com/EpistasisLab/tpot/blob/b626271e6b5896a73fb9d7d29bebc7aa9100772e/tpot/base.py#L850-L895
[ "def", "_summary_of_best_pipeline", "(", "self", ",", "features", ",", "target", ")", ":", "if", "not", "self", ".", "_optimized_pipeline", ":", "raise", "RuntimeError", "(", "'There was an error in the TPOT optimization '", "'process. This could be because the data was '", ...
b626271e6b5896a73fb9d7d29bebc7aa9100772e