maxframe.dataframe.Series#
- class maxframe.dataframe.Series(data=None, index=None, dtype=None, name=None, copy=False, chunk_size=None, gpu=None, sparse=None, num_partitions=None, dtype_backend=None)[源代码]#
- __init__(data=None, index=None, dtype=None, name=None, copy=False, chunk_size=None, gpu=None, sparse=None, num_partitions=None, dtype_backend=None)[源代码]#
方法
__init__([data, index, dtype, name, copy, ...])abs()add(other[, level, fill_value, axis])返回 Series 和 other 的逐元素加法(二元运算符 add)。
add_prefix(prefix)使用字符串 prefix 作为标签前缀。
add_suffix(suffix)使用字符串 suffix 作为标签后缀。
agg([func, axis])在指定轴上使用一个或多个操作进行聚合。
aggregate([func, axis])在指定轴上使用一个或多个操作进行聚合。
align(other[, join, axis, level, copy, ...])使用指定的连接方法在轴上对齐两个对象。
all([axis, bool_only, skipna, level, method])any([axis, bool_only, skipna, level, method])append(other[, ignore_index, ...])将 other 的行追加到调用者的末尾,返回一个新对象。
apply(func[, convert_dtype, output_type, ...])在 Series 的值上调用函数。
argmax([axis, skipna])返回 Series 中最小值的整数位置。
argmin([axis, skipna])返回 Series 中最小值的整数位置。
argsort([axis, kind, order, stable])返回能够排序 Series 值的整数索引。
around([decimals])将 Series 中的每个值四舍五入到指定的小数位数。
astype(dtype[, copy, errors])将 pandas 对象转换为指定的
dtype类型。at_time(time[, axis])选择一天中特定时间的值(例如,上午9:30)。
autocorr([lag])计算滞后 N 的自相关性。
backfill([axis, inplace, limit, downcast])与
DataFrame.fillna()方法中method='bfill'参数等价。between(left, right[, inclusive])返回一个布尔 Series,表示数据是否满足 left <= series <= right。
between_time(start_time, end_time[, ...])选择一天中特定时间之间的值(例如,上午9:00-9:30)。
bfill([axis, inplace, limit, downcast])与
DataFrame.fillna()方法中method='bfill'参数等价。case_when(caselist)根据条件为 True 的情况替换值。
check_monotonic([decreasing, strict])检查对象中的值是否单调递增或递减。
clip([lower, upper, axis, inplace])将超出输入阈值范围的值进行裁剪。
combine(other, func[, fill_value])根据 func 将当前 Series 与另一个 Series 或标量进行组合。
combine_first(other)使用 'other' 中相同位置的值更新空元素。
compare(other[, align_axis, keep_shape, ...])与另一个 Series 进行比较并显示差异。
convert_dtypes([infer_objects, ...])使用支持
pd.NA的数据类型将列转换为最佳的数据类型。copy([deep])复制该对象的索引和数据。
copy_from(obj)copy_to(target)corr(other[, method, min_periods])计算与 other Series 的相关性,排除缺失值。
count([level])cov(other[, min_periods, ddof])计算与 Series 的协方差,排除缺失值。
cummax([axis, skipna])cummin([axis, skipna])cumprod([axis, skipna])cumsum([axis, skipna])describe([percentiles, include, exclude])生成描述性统计信息。
diff([periods])元素的一阶差分。
div(other[, level, fill_value, axis])返回 Series 和 other 的浮点数除法,逐元素(二元运算符 truediv)。
dot(other)计算 Series 与 other 列之间的点积。
drop([labels, axis, index, columns, level, ...])返回删除了指定索引标签的 Series。
drop_duplicates([keep, inplace, ...])返回删除了重复值的 Series。
droplevel(level[, axis])返回删除了请求的索引/列层级的 Series/DataFrame。
dropna([axis, inplace, how, ignore_index])返回一个删除了缺失值的新 Series。
duplicated([keep, method])标识重复的 Series 值。
eq(other[, level, fill_value, axis])返回 Series 和 other 的逐元素相等比较(二元运算符 eq)。
ewm([com, span, halflife, alpha, ...])提供指数加权函数。
execute([session])expanding([min_periods, shift, reverse_range])提供扩展变换。
explode([ignore_index, default_index_type])将列表-like的每个元素转换为一行。
factorize([sort, use_na_sentinel])将对象编码为枚举类型或分类变量。
ffill([axis, inplace, limit, downcast])使用
method='ffill'的DataFrame.fillna()的同义词。fillna([value, method, axis, inplace, ...])使用指定方法填充 NA/NaN 值。
filter([items, like, regex, axis])根据指定的索引标签筛选 DataFrame 的行或列。
返回第一个非 NA 值的索引,如果没有找到则返回 None。
floordiv(other[, level, fill_value, axis])返回 Series 和 other 的整数除法结果,按元素计算(二元运算符 floordiv)。
from_tensor(tensor[, index, name, dtype, ...])ge(other[, level, fill_value, axis])返回 Series 与 other 的大于等于比较结果,按元素计算(二元运算符 ge)。
groupby([by, level, as_index, sort, ...])使用映射器或 Series 列对 DataFrame 进行分组。
gt(other[, level, fill_value, axis])返回 Series 与 other 的大于比较结果,按元素计算(二元运算符 gt)。
head([n])返回前 n 行。
idxmax([axis, skipna])返回最大值所在的行标签。
idxmin([axis, skipna])返回最小值所在的行标签。
infer_objects([copy])尝试为 object 类型列推断更好的数据类型。
isin(values)判断 Series 中的元素是否包含在 values 中。
isna()检测缺失值。
isnull()检测缺失值。
items([batch_size, session])惰性迭代 (index, value) 元组。
iteritems([batch_size, session])惰性迭代 (index, value) 元组。
keys()返回 index 的别名。
kurt([axis, skipna, level, bias, fisher, method])kurtosis([axis, skipna, level, bias, ...])返回最后一个非 NA 值的索引,如果没有找到非 NA 值则返回 None。
le(other[, level, fill_value, axis])返回 Series 和 other 的小于等于比较结果,逐元素进行(二元运算符 le)。
lt(other[, level, fill_value, axis])返回 Series 和 other 的小于比较结果,逐元素进行(二元运算符 lt)。
map(arg[, na_action, dtype, memory_scale, ...])根据输入映射关系映射 Series 的值。
mask(cond[, other, inplace, axis, level, ...])替换满足条件为 True 的值。
max([axis, skipna, level, method])mean([axis, skipna, level, method])median([axis, skipna, level, method])memory_usage([index, deep])返回 Series 的内存使用量。
min([axis, skipna, level, method])mod(other[, level, fill_value, axis])返回 Series 和 other 的模运算结果,逐元素进行(二元运算符 mod)。
mode([dropna, combine_size])返回 Series 的众数。
mul(other[, level, fill_value, axis])返回序列与另一个对象的逐元素相乘结果(二元运算符 mul)。
multiply(other[, level, fill_value, axis])返回序列与另一个对象的逐元素相乘结果(二元运算符 mul)。
ne(other[, level, fill_value, axis])返回序列与另一个对象的逐元素不等比较结果(二元运算符 ne)。
nlargest(n[, keep])返回最大的 n 个元素。
notna()检测存在的(非缺失)值。
notnull()检测存在的(非缺失)值。
nsmallest(n[, keep])返回最小的 n 个元素。
nunique([dropna])返回对象中唯一元素的数量。
pad([axis, inplace, limit, downcast])使用
method='ffill'的DataFrame.fillna()的同义词。pct_change([periods, fill_method, limit, freq])当前元素与前一个元素之间的百分比变化。
pop(item)使用传入的 Series 的值就地修改当前 Series。
pow(other[, level, fill_value, axis])返回序列与另一个对象的逐元素指数幂运算结果(二元运算符 pow)。
prod([axis, skipna, level, min_count, method])product([axis, skipna, level, min_count, method])quantile([q, interpolation])返回给定分位数处的值。
radd(other[, level, fill_value, axis])返回序列与另一个对象的逐元素加法结果(二元运算符 radd)。
rank([axis, method, numeric_only, ...])沿轴计算数值数据的排名(从1到n)。
rdiv(other[, level, fill_value, axis])返回序列与另一个对象的逐元素除法结果(二元运算符 rtruediv)。
rechunk(chunk_size[, reassign_worker])重新划分 DataFrame、Series 或 Index 数据的分片。
reindex([labels, index, columns, axis, ...])将 Series/DataFrame 调整为新索引,并可选择填充逻辑。
reindex_like(other[, method, copy, limit, ...])返回一个与另一个对象具有匹配索引的对象。
rename([index, axis, copy, inplace, level, ...])更改 Series 的索引标签或名称。
rename_axis([mapper, index, columns, axis, ...])为索引或列设置轴的名称。
reorder_levels(order)使用输入顺序重新排列索引层级。
repeat(repeats[, axis])重复 Series 的元素。
replace([to_replace, value, inplace, limit, ...])将 to_replace 中指定的值替换为 value。
reset_index([level, drop, name, inplace])生成一个新的 DataFrame 或 Series,并重置其索引。
rfloordiv(other[, level, fill_value, axis])返回 Series 和 other 的整数除法,逐元素(二元运算符 rfloordiv)。
rmod(other[, level, fill_value, axis])返回 Series 和 other 的模运算结果,逐元素(二元运算符 rmod)。
rmul(other[, level, fill_value, axis])返回 Series 和 other 的乘法结果,逐元素(二元运算符 rmul)。
rolling(window[, min_periods, center, ...])提供滚动窗口计算。
round([decimals])将 Series 中的每个值四舍五入到指定的小数位数。
rpow(other[, level, fill_value, axis])返回 Series 和 other 的指数幂,逐元素(二元运算符 rpow)。
rsub(other[, level, fill_value, axis])返回 Series 和 other 的减法结果,逐元素(二元运算符 rsubtract)。
rtruediv(other[, level, fill_value, axis])返回序列与另一个对象的逐元素除法结果(二元运算符 rtruediv)。
sample([n, frac, replace, weights, ...])从对象的某个轴返回一组随机样本。
sem([axis, skipna, level, ddof, method])set_axis(labels[, axis, inplace])将指定的索引分配给给定的轴。
shift([periods, freq, axis, fill_value])按指定的周期数(可选时间频率)移动索引。
skew([axis, skipna, level, bias, method])sort_index([axis, level, ascending, ...])按标签(沿轴)排序对象。
sort_values([axis, ascending, inplace, ...])按值排序。
std([axis, skipna, level, ddof, method])sub(other[, level, fill_value, axis])返回 Series 和 other 逐元素相减的结果(二元运算符 subtract)。
sum([axis, skipna, level, min_count, method])swaplevel([i, j])交换
MultiIndex中的两个层级 i 和 j。tail([n])返回最后 n 行。
take(indices[, axis])根据给定的*位置*索引沿轴返回元素。
to_clipboard(*[, excel, sep, batch_size, ...])将对象复制到系统剪贴板。
to_csv(path[, sep, na_rep, float_format, ...])将对象写入逗号分隔的值(CSV)文件。
to_dict([into, batch_size, session])将 Series 转换为 {标签 -> 值} 字典或类似字典的对象。
to_frame([name])将 Series 转换为 DataFrame。
to_json([path, orient, date_format, ...])将对象转换为 JSON 字符串。
to_list([batch_size, session])以 Python list 返回值。
to_pandas([session])to_tensor([dtype])transform(func[, convert_dtype, axis, ...])在自身上调用
func生成具有变换后值的 Series。truediv(other[, level, fill_value, axis])返回 Series 和 other 的浮点数除法,逐元素(二元运算符 truediv)。
truncate([before, after, axis, copy])在某个索引值前后截断 Series 或 DataFrame。
tshift([periods, freq, axis])时间索引向前移动,如果可用则使用索引的频率。
unique([method])返回 Series 中唯一值,按照出现顺序排列。
unstack([level, fill_value])取消堆叠,也称为透视,将具有 MultiIndex 的 Series 转换为 DataFrame。
update(other)使用传入的 Series 的值就地修改当前 Series。
value_counts([normalize, sort, ascending, ...])返回包含唯一值计数的 Series。
var([axis, skipna, level, ddof, method])where(cond[, other, inplace, axis, level, ...])替换条件为 False 的值。
xs(key[, axis, level, drop_level])返回来自 Series/DataFrame 的交叉部分。
属性
返回转置,根据定义即为自身。
通过行/列标签对访问单个值。
data返回底层数据的 dtype 对象。
通过整数位置访问行/列对的单个值。
基于纯整数位置的索引,用于按位置选择。
Series 的索引(轴标签)。
is_monotonic返回索引是否单调递增。
返回布尔标量,表示对象中的值是否单调递减。
返回索引是否单调递增。
返回布尔值,表示对象中的值是否唯一。
通过标签或布尔数组访问一组行和列。
返回一个整数,表示轴数/数组维度。
sizetype_namevalues