系列#

构造器#

Series \([data, index, dtype, name, copy, ...] )

带有轴标签的一维ndarray(包括时间序列)。

属性#

Axes

Series.index 

系列的索引(轴标签)。

Series.array 

支持此系列或索引的数据的扩展数组。

Series.values 

根据数据类型将系列返回为ndarray或类似ndarray。

Series.dtype 

返回底层数据的dtype对象。

Series.shape 

返回基础数据的形状的元组。

Series.nbytes 

返回基础数据中的字节数。

Series.ndim 

根据定义1,基础数据的维度数。

Series.size 

返回基础数据中的元素数。

Series.T 

返回转置,根据定义,转置是self。

Series.memory_usage \([index, deep] )

返回该系列的内存使用情况。

Series.hasnans 

如果有任何NAN,则返回True。

Series.empty 

指示Series/DataFrame是否为空。

Series.dtypes 

返回底层数据的dtype对象。

Series.name 

返回系列的名称。

Series.flags 

获取与此Pandas对象关联的属性。

Series.set_flags \(*[, copy, ...] )

返回一个具有更新标志的新对象。

转换#

Series.astype \(dtype[, copy, errors] )

将Pandas对象强制转换为指定的dtype dtype

Series.convert_dtypes \([infer_objects, ...] )

使用支持的数据类型将列转换为最佳数据类型 pd.NA

Series.infer_objects \()

尝试为对象列推断更好的数据类型。

Series.copy \([deep] )

复制此对象的索引和数据。

Series.bool \()

返回单个元素Series或DataFrame的布尔值。

Series.to_numpy \([dtype, copy, na_value] )

表示此系列或索引中的值的NumPy ndarray。

Series.to_period \([freq, copy] )

将系列从DatetimeIndex转换为PerodIndex。

Series.to_timestamp \([freq, how, copy] )

强制转换为时间戳的DatetimeIndex,位于 起头 属于那个时期。

Series.to_list \()

返回值列表。

Series.__array__ \([dtype] )

以NumPy数组的形式返回值。

索引、迭代#

Series.get \(密钥[, default] )

从给定键的对象中获取项(例如:DataFrame列)。

Series.at 

访问行/列标签对的单个值。

Series.iat 

按整数位置访问行/列对的单个值。

Series.loc 

通过标签或布尔数组访问一组行和列。

Series.iloc 

纯粹基于整数位置的索引,用于按位置选择。

Series.__iter__ \()

返回值的迭代器。

Series.items \()

懒惰地迭代(索引、值)元组。

Series.iteritems \()

懒惰地迭代(索引、值)元组。

Series.keys \()

返回索引的别名。

Series.pop \(项目)

从系列中退货和退货。

Series.item \()

将底层数据的第一个元素作为Python标量返回。

Series.xs \(密钥[, axis, level, drop_level] )

从系列/数据帧返回横截面。

有关以下内容的更多信息: .at.iat.loc ,以及 .iloc ,请参阅 indexing documentation

二元算子函数#

Series.add \(其他[, level, fill_value, axis] )

按元素(二元运算符)返回级数和其他的相加 add )。

Series.sub \(其他[, level, fill_value, axis] )

级数和其他元素的返回减法(二元运算符 sub )。

Series.mul \(其他[, level, fill_value, axis] )

级数和其他元素的返回乘法(二元运算符 mul )。

Series.div \(其他[, level, fill_value, axis] )

返回按元素(二元运算符)的级数和其他的浮点除法 truediv )。

Series.truediv \(其他[, level, fill_value, axis] )

返回按元素(二元运算符)的级数和其他的浮点除法 truediv )。

Series.floordiv \(其他[, level, fill_value, axis] )

返回级数和其他元素的整数除法(二元运算符 floordiv )。

Series.mod \(其他[, level, fill_value, axis] )

级数和其他元素的返回模数(二元运算符 mod )。

Series.pow \(其他[, level, fill_value, axis] )

返回级数和其他元素的指数幂(二元运算符 pow )。

Series.radd \(其他[, level, fill_value, axis] )

按元素(二元运算符)返回级数和其他的相加 radd )。

Series.rsub \(其他[, level, fill_value, axis] )

级数和其他元素的返回减法(二元运算符 rsub )。

Series.rmul \(其他[, level, fill_value, axis] )

级数和其他元素的返回乘法(二元运算符 rmul )。

Series.rdiv \(其他[, level, fill_value, axis] )

返回按元素(二元运算符)的级数和其他的浮点除法 rtruediv )。

Series.rtruediv \(其他[, level, fill_value, axis] )

返回按元素(二元运算符)的级数和其他的浮点除法 rtruediv )。

Series.rfloordiv \(其他[, level, fill_value, ...] )

返回级数和其他元素的整数除法(二元运算符 rfloordiv )。

Series.rmod \(其他[, level, fill_value, axis] )

级数和其他元素的返回模数(二元运算符 rmod )。

Series.rpow \(其他[, level, fill_value, axis] )

返回级数和其他元素的指数幂(二元运算符 rpow )。

Series.combine \(其他、函数 [, fill_value] )

根据将系列与系列或标量组合在一起 func

Series.combine_first \(其他)

使用‘Other’中相同位置的值更新空元素。

Series.round \([decimals] )

将序列中的每个值四舍五入到给定的小数位数。

Series.lt \(其他[, level, fill_value, axis] )

按元素(二元运算符)返回小于级数和其他 lt )。

Series.gt \(其他[, level, fill_value, axis] )

按元素(二元运算符)返回系列和其他的大于 gt )。

Series.le \(其他[, level, fill_value, axis] )

按元素(二元运算符)返回小于或等于的级数和其他 le )。

Series.ge \(其他[, level, fill_value, axis] )

按元素(二元运算符)返回大于或等于级数和其他 ge )。

Series.ne \(其他[, level, fill_value, axis] )

按元素(二元运算符)返回不等于的级数和其他 ne )。

Series.eq \(其他[, level, fill_value, axis] )

按元素(二元运算符)返回级数和其他的等于 eq )。

Series.product \([axis, skipna, level, ...] )

返回值在请求的轴上的乘积。

Series.dot \(其他)

计算级数和其他列之间的点积。

函数应用程序,分组依据窗口(&W)#

Series.apply \(函数[, convert_dtype, args] )

对系列的值调用函数。

Series.agg \([func, axis] )

使用指定轴上的一个或多个操作进行聚合。

Series.aggregate \([func, axis] )

使用指定轴上的一个或多个操作进行聚合。

Series.transform \(函数[, axis] )

打电话 func 关于自己产生与自己具有相同轴形的级数。

Series.map \(参数[, na_action] )

根据输入映射或函数映射系列的值。

Series.groupby \([by, axis, level, as_index, ...] )

使用映射器或按一系列柱对系列进行分组。

Series.rolling \(窗口[, min_periods, ...] )

提供滚动窗口计算。

Series.expanding \([min_periods, center, ...] )

提供扩展窗口计算。

Series.ewm \([com, span, halflife, alpha, ...] )

提供指数加权(EW)计算。

Series.pipe \(函数,*args, * *kwargs)

应用预期为Series或DataFrame的可链接函数。

计算/描述性统计#

Series.abs \()

返回一个具有每个元素的绝对数值的Series/DataFrame。

Series.all \([axis, bool_only, skipna, level] )

返回是否所有元素都为True,可能是在某个轴上。

Series.any \([axis, bool_only, skipna, level] )

返回是否有任何元素为True,可能是在轴上。

Series.autocorr \([lag] )

计算LAG-N自相关。

Series.between \(左、右[, inclusive] )

返回等同于Left<=Series<=Right的布尔级数。

Series.clip \([lower, upper, axis, inplace] )

修剪输入阈值上的值。

Series.corr \(其他[, method, min_periods] )

计算相关性与 other 序列,不包括缺失值。

Series.count \([level] )

返回序列中非NA/NULL观测值的数量。

Series.cov \(其他[, min_periods, ddof] )

计算系列协方差,不包括缺失值。

Series.cummax \([axis, skipna] )

返回DataFrame或Series轴上的累计最大值。

Series.cummin \([axis, skipna] )

返回DataFrame或Series轴上的累计最小值。

Series.cumprod \([axis, skipna] )

返回DataFrame或Series轴上的累计积。

Series.cumsum \([axis, skipna] )

返回DataFrame或Series轴上的累计和。

Series.describe \([percentiles, include, ...] )

生成描述性统计数据。

Series.diff \([periods] )

单元的一阶离散差分。

Series.factorize \([sort, na_sentinel] )

将对象编码为枚举类型或类别变量。

Series.kurt \([axis, skipna, level, numeric_only] )

返回请求的轴上的无偏峰度。

Series.mad \([axis, skipna, level] )

(已弃用)返回值在请求的轴上的平均绝对偏差。

Series.max \([axis, skipna, level, numeric_only] )

返回请求的轴上的最大值。

Series.mean \([axis, skipna, level, numeric_only] )

返回请求的轴上的值的平均值。

Series.median \([axis, skipna, level, ...] )

返回值在请求的轴上的中位数。

Series.min \([axis, skipna, level, numeric_only] )

返回请求的轴上的最小值。

Series.mode \([dropna] )

返回系列的模式。

Series.nlargest \([n, keep] )

退回最大的 n 元素。

Series.nsmallest \([n, keep] )

返回最小的 n 元素。

Series.pct_change \([periods, fill_method, ...] )

当前元素和前一个元素之间的百分比变化。

Series.prod \([axis, skipna, level, ...] )

返回值在请求的轴上的乘积。

Series.quantile \([q, interpolation] )

返回给定分位数的值。

Series.rank \([axis, method, numeric_only, ...] )

沿轴计算数值数据排名(从1到n)。

Series.sem \([axis, skipna, level, ddof, ...] )

返回请求轴上平均值的无偏标准误差。

Series.skew \([axis, skipna, level, numeric_only] )

返回请求的轴上的无偏斜。

Series.std \([axis, skipna, level, ddof, ...] )

返回要求轴上的样本标准偏差。

Series.sum \([axis, skipna, level, ...] )

返回请求的轴上的值的总和。

Series.var \([axis, skipna, level, ddof, ...] )

返回请求的轴上的无偏差。

Series.kurtosis \([axis, skipna, level, ...] )

返回请求的轴上的无偏峰度。

Series.unique \()

返回Series对象的唯一值。

Series.nunique \([dropna] )

返回对象中唯一元素的数量。

Series.is_unique 

如果对象中的值是唯一的,则返回布尔值。

Series.is_monotonic 

如果对象中的值是单调递增的,则返回布尔值。

Series.is_monotonic_increasing 

如果对象中的值是单调递增的,则返回布尔值。

Series.is_monotonic_decreasing 

如果对象中的值是单调递减的,则返回布尔值。

Series.value_counts \([normalize, sort, ...] )

返回包含唯一值计数的系列。

重建索引/选择/标签操作#

Series.align \(其他[, join, axis, level, ...] )

将两个对象的轴向与指定的联接方法对齐。

Series.drop \([labels, axis, index, columns, ...] )

删除了指定索引标签的返回系列。

Series.droplevel \(级别[, axis] )

返回删除了请求的索引/列级别的Series/DataFrame。

Series.drop_duplicates \([keep, inplace] )

已删除重复值的返回系列。

Series.duplicated \([keep] )

表示重复的系列值。

Series.equals \(其他)

测试两个对象是否包含相同的元素。

Series.first \(偏移)

根据日期偏移量选择时间序列数据的初始期间。

Series.head \([n] )

返回第一个 n 排好了。

Series.idxmax \([axis, skipna] )

返回最大值的行标签。

Series.idxmin \([axis, skipna] )

返回最小值的行标签。

Series.isin \(值)

系列中的元素是否包含在 values

Series.last \(偏移)

根据日期偏移量选择时间序列数据的最终期间。

Series.reindex \(*args, * *kwargs)

通过可选的填充逻辑使系列符合新的索引。

Series.reindex_like \(其他[, method, copy, ...] )

将索引匹配的对象作为其他对象返回。

Series.rename \([index, axis, copy, inplace, ...] )

更改系列索引标签或名称。

Series.rename_axis \([mapper, index, columns, ...] )

设置索引或列的轴的名称。

Series.reset_index \([level, drop, name, ...] )

在重置索引的情况下生成新的DataFrame或Series。

Series.sample \([n, frac, replace, weights, ...] )

从对象轴返回项目的随机样本。

Series.set_axis \(标签[, axis, inplace] )

将所需的索引指定给给定轴。

Series.take \(索引[, axis, is_copy] )

返回给定元素中的元素 位置 沿轴的索引。

Series.tail \([n] )

退还最后一张 n 排好了。

Series.truncate \([before, after, axis, copy] )

在某些索引值之前和之后截断Series或DataFrame。

Series.where \(条件[, other, inplace, axis, ...] )

替换条件为FALSE的值。

Series.mask \(条件[, other, inplace, axis, ...] )

替换条件为True的值。

Series.add_prefix \(前缀)

使用字符串为标签添加前缀 prefix

Series.add_suffix \(后缀)

使用字符串为标签添加后缀 suffix

Series.filter \([items, like, regex, axis] )

根据指定的索引标签子集数据帧的行或列。

缺少数据处理#

Series.backfill \([axis, inplace, limit, downcast] )

的同义词 DataFrame.fillna() 使用 method='bfill'

Series.bfill \([axis, inplace, limit, downcast] )

的同义词 DataFrame.fillna() 使用 method='bfill'

Series.dropna \([axis, inplace, how] )

返回删除了缺失值的新系列。

Series.ffill \([axis, inplace, limit, downcast] )

的同义词 DataFrame.fillna() 使用 method='ffill'

Series.fillna \([value, method, axis, ...] )

使用指定的方法填充NA/NaN值。

Series.interpolate \([method, axis, limit, ...] )

使用插值法填充NaN值。

Series.isna \()

检测缺少的值。

Series.isnull \()

Series.isull是Series.isna的别名。

Series.notna \()

检测现有(非缺失)值。

Series.notnull \()

Series.notull是Series.notna的别名。

Series.pad \([axis, inplace, limit, downcast] )

的同义词 DataFrame.fillna() 使用 method='ffill'

Series.replace \([to_replace, value, inplace, ...] )

替换中给出的值 to_replace 使用 value

重塑,排序#

Series.argsort \([axis, kind, order] )

返回对Series值进行排序的整数索引。

Series.argmin \([axis, skipna] )

返回序列中最小值的int位置。

Series.argmax \([axis, skipna] )

返回序列中最大值的整型位置。

Series.reorder_levels \(订单)

使用输入顺序重新排列索引级别。

Series.sort_values \([axis, ascending, ...] )

按值排序。

Series.sort_index \([axis, level, ascending, ...] )

按索引标签对系列进行排序。

Series.swaplevel \([i, j, copy] )

中交换级别i和j。 MultiIndex

Series.unstack \([level, fill_value] )

取消堆叠,也称为Pivot,与多索引串联以生成DataFrame。

Series.explode \([ignore_index] )

将类似列表的每个元素转换为行。

Series.searchsorted \(值[, side, sorter] )

查找应插入元素以维持顺序的索引。

Series.ravel \([order] )

将拼合的基础数据作为ndarray返回。

Series.repeat \(重复[, axis] )

重复系列的元素。

Series.squeeze \([axis] )

将1维轴对象压缩为标量。

Series.view \([dtype] )

创建系列的新视图。

合并/比较/合并/合并#

Series.append \(至_追加[, ignore_index, ...] )

(已弃用)串联两个或多个系列。

Series.compare \(其他[, align_axis, ...] )

与其他系列进行比较,并显示不同之处。

Series.update \(其他)

使用传递的系列中的值就地修改系列。

访问者#

Pandas在各种访问器下提供特定于dtype的方法。它们是内的单独的命名空间 Series 这只适用于特定的数据类型。

数据类型

访问者

DateTime,Timedelta,句号

dt

细绳

str

直截了当的

cat

稀疏

sparse

类DateTime属性#

Series.dt 可用于以类似DateTime的形式访问序列的值并返回几个属性。可以像这样访问这些内容 Series.dt.<property>

DateTime属性#

Series.dt.date 

返回PYTHON的NumPy数组 datetime.date 对象。

Series.dt.time 

返回NumPy数组 datetime.time 对象。

Series.dt.timetz 

返回NumPy数组 datetime.time 具有时区信息的对象。

Series.dt.year 

日期时间的年份。

Series.dt.month 

月份为1月=1,12月=12。

Series.dt.day 

约会时间的日期。

Series.dt.hour 

约会时间的小时数。

Series.dt.minute 

约会时间的分钟数。

Series.dt.second 

日期时间的秒数。

Series.dt.microsecond 

日期时间的微秒数。

Series.dt.nanosecond 

日期时间的纳秒。

Series.dt.week 

(已弃用)根据ISO 8601标准,一年中的第几周。

Series.dt.weekofyear 

(已弃用)根据ISO 8601标准,一年中的第几周。

Series.dt.dayofweek 

星期一=0,星期日=6的星期几。

Series.dt.day_of_week 

星期一=0,星期日=6的星期几。

Series.dt.weekday 

星期一=0,星期日=6的星期几。

Series.dt.dayofyear 

一年中的第几天。

Series.dt.day_of_year 

一年中的第几天。

Series.dt.quarter 

日期的第1季度。

Series.dt.is_month_start 

指示日期是否为每月的第一天。

Series.dt.is_month_end 

指示日期是否为该月的最后一天。

Series.dt.is_quarter_start 

日期是否为季度的第一天的指示器。

Series.dt.is_quarter_end 

日期是否为季度的最后一天的指示器。

Series.dt.is_year_start 

指示日期是否为一年的第一天。

Series.dt.is_year_end 

指示该日期是否为一年的最后一天。

Series.dt.is_leap_year 

日期是否属于闰年的布尔指示符。

Series.dt.daysinmonth 

一个月中的天数。

Series.dt.days_in_month 

一个月中的天数。

Series.dt.tz 

返回时区。

Series.dt.freq 

返回此周期数组的频率对象。

DateTime方法#

Series.dt.isocalendar \()

根据ISO 8601标准计算年、周和日。

Series.dt.to_period \(*args, * *kwargs)

以特定频率强制转换为周期数组/索引。

Series.dt.to_pydatetime \()

将数据作为 datetime.datetime 对象。

Series.dt.tz_localize \(*args, * *kwargs)

将tz-naive DateTime数组/索引本地化为TZ感知的DateTime数组/索引。

Series.dt.tz_convert \(*args, * *kwargs)

将TZ感知的DateTime数组/索引从一个时区转换为另一个时区。

Series.dt.normalize \(*args, * *kwargs)

将时间转换为午夜。

Series.dt.strftime \(*args, * *kwargs)

使用指定的Date_Format转换为索引。

Series.dt.round \(*args, * *kwargs)

将数据四舍五入到指定的 freq

Series.dt.floor \(*args, * *kwargs)

对指定的数据执行底层操作 freq

Series.dt.ceil \(*args, * *kwargs)

对数据执行CEIL运算到指定的 freq

Series.dt.month_name \(*args, * *kwargs)

属性的月份名称。 SeriesDatetimeIndex 具有指定的区域设置。

Series.dt.day_name \(*args, * *kwargs)

属性的日期名称。 SeriesDatetimeIndex 具有指定的区域设置。

期间属性#

Series.dt.qyear 

Series.dt.start_time 

获取时段开始的时间戳。

Series.dt.end_time 

获取时段结束的时间戳。

Timedelta属性#

Series.dt.days 

每个元素的天数。

Series.dt.seconds 

每个元素的秒数(>=0且小于1天)。

Series.dt.microseconds 

每个元素的微秒数(>=0且小于1秒)。

Series.dt.nanoseconds 

每个元素的纳秒数(>=0且小于1微秒)。

Series.dt.components 

返回Timedeltas组件的数据帧。

Timedelta方法#

Series.dt.to_pytimedelta \()

返回本机的数组 datetime.timedelta 对象。

Series.dt.total_seconds \(*args, * *kwargs)

返回每个元素的总持续时间,以秒为单位。

字符串处理#

Series.str 可用于以字符串形式访问序列的值,并对其应用多种方法。可以像这样访问这些内容 Series.str.<function/property>

Series.str.capitalize \()

将系列/索引中的字符串转换为大写。

Series.str.casefold \()

将序列/索引中的字符串转换为大小写折叠。

Series.str.cat \([others, sep, na_rep, join] )

使用给定的分隔符连接序列/索引中的字符串。

Series.str.center \(宽度[, fillchar] )

在序列/索引中填充字符串的左侧和右侧。

Series.str.contains \(PAT[, case, flags, na, ...] )

测试序列或索引的字符串中是否包含模式或正则表达式。

Series.str.count \(PAT[, flags] )

统计序列/索引的每个字符串中模式的出现次数。

Series.str.decode \(编码[, errors] )

使用指定的编码对序列/索引中的字符串进行解码。

Series.str.encode \(编码[, errors] )

使用指定的编码对序列/索引中的字符串进行编码。

Series.str.endswith \(PAT[, na] )

测试每个字符串元素的结尾是否与模式匹配。

Series.str.extract \(PAT[, flags, expand] )

在正则表达式中提取捕获组 pat 作为DataFrame中的列。

Series.str.extractall \(PAT[, flags] )

在正则表达式中提取捕获组 pat 作为DataFrame中的列。

Series.str.find \(SUB [, start, end] )

返回序列/索引中每个字符串中的最低索引。

Series.str.findall \(PAT[, flags] )

查找序列/索引中模式或正则表达式的所有匹配项。

Series.str.fullmatch \(PAT[, case, flags, na] )

确定每个字符串是否与正则表达式完全匹配。

Series.str.get \(i)

从指定位置的每个组件中提取元素。

Series.str.index \(SUB [, start, end] )

返回序列/索引中每个字符串的最低索引。

Series.str.join \(9月)

使用传递的分隔符联接作为系列/索引中的元素包含的列表。

Series.str.len \()

计算系列/索引中每个元素的长度。

Series.str.ljust \(宽度[, fillchar] )

在序列/索引中填充字符串的右侧。

Series.str.lower \()

将系列/索引中的字符串转换为小写。

Series.str.lstrip \([to_strip] )

删除前导字符。

Series.str.match \(PAT[, case, flags, na] )

确定每个字符串是否以正则表达式的匹配项开头。

Series.str.normalize \(表格)

返回序列/索引中字符串的Unicode范式。

Series.str.pad \(宽度[, side, fillchar] )

将系列/索引中的字符串填充到宽度。

Series.str.partition \([sep, expand] )

在第一次出现时拆分字符串 sep

Series.str.removeprefix \(前缀)

从对象序列中删除前缀。

Series.str.removesuffix \(后缀)

从对象序列中删除后缀。

Series.str.repeat \(重复)

复制系列或索引中的每个字符串。

Series.str.replace \(Pat,Repl[, n, case, ...] )

替换系列/索引中出现的每个模式/正则表达式。

Series.str.rfind \(SUB [, start, end] )

返回序列/索引中每个字符串中的最高索引。

Series.str.rindex \(SUB [, start, end] )

返回序列/索引中每个字符串中的最高索引。

Series.str.rjust \(宽度[, fillchar] )

填充系列/索引中字符串的左侧。

Series.str.rpartition \([sep, expand] )

在最后一次出现时拆分字符串 sep

Series.str.rstrip \([to_strip] )

删除尾随字符。

Series.str.slice \([start, stop, step] )

切分系列或索引中每个元素的子字符串。

Series.str.slice_replace \([start, stop, repl] )

用另一个值替换字符串的位置片段。

Series.str.split \([pat, n, expand, regex] )

在给定的分隔符/分隔符周围拆分字符串。

Series.str.rsplit \([pat, n, expand] )

在给定的分隔符/分隔符周围拆分字符串。

Series.str.startswith \(PAT[, na] )

测试每个字符串元素的开头是否与模式匹配。

Series.str.strip \([to_strip] )

删除前导字符和尾随字符。

Series.str.swapcase \()

将序列/索引中的字符串转换为交换。

Series.str.title \()

将系列/索引中的字符串转换为大小写。

Series.str.translate \(表)

通过给定的映射表映射字符串中的所有字符。

Series.str.upper \()

将序列/索引中的字符串转换为大写。

Series.str.wrap \(宽度, ** Kwargs)

序列/索引中的字符串以指定的行宽换行。

Series.str.zfill \(宽度)

在序列/索引中添加前缀‘0’字符的字符串。

Series.str.isalnum \()

检查每个字符串中的所有字符是否都是字母数字。

Series.str.isalpha \()

检查每个字符串中的所有字符是否都是字母。

Series.str.isdigit \()

检查每个字符串中的所有字符是否都是数字。

Series.str.isspace \()

检查每个字符串中的所有字符是否都是空格。

Series.str.islower \()

检查每个字符串中的所有字符是否都是小写。

Series.str.isupper \()

检查每个字符串中的所有字符是否均为大写。

Series.str.istitle \()

检查每个字符串中的所有字符是否都是大小写。

Series.str.isnumeric \()

检查每个字符串中的所有字符是否都是数字。

Series.str.isdecimal \()

检查每个字符串中的所有字符是否都是小数。

Series.str.get_dummies \([sep] )

返回Series的伪变量/指示器变量的DataFrame。

范畴存取器#

类别-dtype特定的方法和属性位于 Series.cat 访问者。

Series.cat.categories 

这个定语的范畴。

Series.cat.ordered 

类别是否具有有序关系。

Series.cat.codes 

返回一系列代码以及索引。

Series.cat.rename_categories \(*args, * *kwargs)

重命名类别。

Series.cat.reorder_categories \(*args, * *kwargs)

按照NEW_CATEGORES中指定的方式对类别进行重新排序。

Series.cat.add_categories \(*args, * *kwargs)

添加新类别。

Series.cat.remove_categories \(*args, * *kwargs)

删除指定的类别。

Series.cat.remove_unused_categories \(*参数,...)

删除不使用的类别。

Series.cat.set_categories \(*args, * *kwargs)

将类别设置为指定的NEW_CACTIONS。

Series.cat.as_ordered \(*args, * *kwargs)

将分类词设置为有序。

Series.cat.as_unordered \(*args, * *kwargs)

将定义词设置为无序。

稀疏访问器#

稀疏数据类型特定的方法和属性在 Series.sparse 访问者。

Series.sparse.npoints 

非政府组织数量 fill_value 分数。

Series.sparse.density 

非政府组织的百分比 fill_value 点,以十进制表示。

Series.sparse.fill_value 

中的元素 data 它们是 fill_value 不会被存储。

Series.sparse.sp_values 

一个ndarray包含非 fill_value 价值。

Series.sparse.from_coo \(a[, dense_index] )

使用来自scipy.parse.coo_Matrix的稀疏值创建一个Series。

Series.sparse.to_coo \([row_levels, ...] )

从具有多索引的Series创建一个scipy.parse.coo_Matrix。

旗子#

标志是指Pandas对象的属性。数据集的属性(如记录的日期、从中访问它的URL等)应存储在 Series.attrs

Flags \(OBJ,*,允许_复制_标签)

适用于Pandas对象的标志。

元数据#

Series.attrs 是用于存储本系列的全局元数据的词典。

警告

Series.attrs 被认为是试验性的,可能会在没有警告的情况下发生变化。

Series.attrs 

此数据集的全局属性的字典。

标绘#

Series.plot 是表单的特定绘图方法的可调用方法和命名空间属性 Series.plot.<kind>

Series.plot \([kind, ax, figsize, ....] )

一种系列绘图存取器和方法

Series.plot.area \([x, y] )

绘制堆叠面积图。

Series.plot.bar \([x, y] )

垂直条形图。

Series.plot.barh \([x, y] )

绘制水平条形图。

Series.plot.box \([by] )

制作DataFrame列的框图。

Series.plot.density \([bw_method, ind] )

使用高斯核生成核密度估计图。

Series.plot.hist \([by, bins] )

绘制DataFrame的列的一个直方图。

Series.plot.kde \([bw_method, ind] )

使用高斯核生成核密度估计图。

Series.plot.line \([x, y] )

将系列或数据帧绘制为线条。

Series.plot.pie \(** Kwargs)

生成饼图。

Series.hist \([by, ax, grid, xlabelsize, ...] )

使用matplotlib绘制输入序列的直方图。

序列化/IO/转换#

Series.to_pickle \(路径[, compression, ...] )

Pickle(序列化)对象到文件。

Series.to_csv \([path_or_buf, sep, na_rep, ...] )

将对象写入逗号分隔值(CSV)文件。

Series.to_dict \([into] )

将系列转换为{标签->值}词典或类似词典的对象。

Series.to_excel \(EXCEL_编写器[, sheet_name, ...] )

将对象写入Excel工作表。

Series.to_frame \([name] )

将系列转换为DataFrame。

Series.to_xarray \()

从Pandas对象返回一个XARRAY对象。

Series.to_hdf \(路径_或_buf,键[, mode, ...] )

使用HDFStore将包含的数据写入HDF5文件。

Series.to_sql \(名称,控制 [, schema, ...] )

将存储在DataFrame中的记录写入SQL数据库。

Series.to_json \([path_or_buf, orient, ...] )

将对象转换为JSON字符串。

Series.to_string \([buf, na_rep, ...] )

呈现序列的字符串表示形式。

Series.to_clipboard \([excel, sep] )

将对象复制到系统剪贴板。

Series.to_latex \([buf, columns, col_space, ...] )

将对象呈现到LaTeX表格、长表或嵌套表。

Series.to_markdown \([buf, mode, index, ...] )

以支持降价的格式打印系列。