code stringlengths 3 6.57k |
|---|
new_data.copy() |
self._constructor(new_data) |
__finalize__(self) |
str (regular expression) |
re.search(regex, label) |
index (int) |
name (str) |
label(s) |
pd.DataFrame(np.array(([1, 2, 3], [4, 5, 6]) |
df.filter(items=['one', 'three']) |
df.filter(regex='e$', axis=1) |
df.filter(like='bbi', axis=0) |
com.count_not_none(items, like, regex) |
self._get_axis(axis) |
self._get_axis_name(axis) |
self.reindex(**{name: [r for r in items if r in labels]}) |
f(x) |
ensure_str(x) |
labels.map(f) |
self.loc(axis=axis) |
f(x) |
matcher.search(ensure_str(x) |
re.compile(regex) |
labels.map(f) |
self.loc(axis=axis) |
TypeError("Must pass either `items`, `like`, or `regex`") |
head(self: FrameOrSeries, n: int = 5) |
df.head() |
lines (three in this case) |
df.head(3) |
df.head(-3) |
tail(self: FrameOrSeries, n: int = 5) |
df.tail() |
lines (three in this case) |
df.tail(3) |
df.tail(-3) |
generator (if int) |
type (0 for Series and DataFrames) |
sample(n=3, random_state=1) |
df.sample(frac=0.5, replace=True, random_state=1) |
df.sample(frac=2, replace=True, random_state=1) |
df.sample(n=2, weights='num_specimen_seen', random_state=1) |
self._get_axis_number(axis) |
com.random_state(random_state) |
isinstance(weights, ABCSeries) |
weights.reindex(self.axes[axis]) |
isinstance(weights, str) |
isinstance(self, ABCDataFrame) |
pd.Series(weights, dtype="float64") |
len(weights) |
if (weights == np.inf) |
any() |
or (weights == -np.inf) |
any() |
ValueError("weight vector may not include `inf` values") |
if (weights < 0) |
any() |
ValueError("weight vector many not include negative values") |
weights.fillna(0) |
weights.sum() |
weights.sum() |
weights.sum() |
ValueError("Invalid weights: weights sum to zero") |
ValueError("Only integers accepted as `n` values") |
int(round(frac * axis_length) |
ValueError("Please enter a value for `frac` OR `n`, not both") |
rs.choice(axis_length, size=n, replace=replace, p=weights) |
self.take(locs, axis=axis) |
func(self, \*args, \*\*kwargs) |
f(g(h(df) |
df.pipe(h) |
pipe(g, arg1=a) |
pipe(f, arg2=b, arg3=c) |
as (say) |
df.pipe(h) |
pipe(g, arg1=a) |
pipe((f, 'arg2') |
Appender(_shared_docs["pipe"] % _shared_doc_kwargs) |
pipe(self, func, *args, **kwargs) |
com.pipe(self, func, *args, **kwargs) |
pd.DataFrame({'A': range(3) |
range(1, 4) |
df.transform(lambda x: x + 1) |
pd.Series(range(3) |
s.transform([np.sqrt, np.exp]) |
isinstance(other, NDFrame) |
isinstance(name, str) |
object.__setattr__(self, name, getattr(other, name, None) |
__getattr__(self, name: str) |
obj.__getattribute__('x') |
obj.__getattr__('x') |
object.__getattribute__(self, name) |
self._info_axis._can_hold_identifiers_and_holds_name(name) |
object.__getattribute__(self, name) |
__setattr__(self, name: str, value) |
object.__getattribute__(self, name) |
object.__setattr__(self, name, value) |
object.__setattr__(self, name, value) |
object.__setattr__(self, name, value) |
getattr(self, name) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.