http://pandas-docs.github.io/pandas-docs-travis/api.html
方法 | 描述 |
---|---|
Series([data, index, dtype, name, copy, …]) | 一维序列 |
方法 | 描述 |
---|---|
Series.index | 轴标签 |
Series.values | 返回序列的数值 |
Series.dtype | 返回数据的类型 |
Series.ftype | return if the data is sparse |
Series.shape | 返回数据的型状 |
Series.nbytes | 返回数据的字节数 |
Series.ndim | 返回数据的维度 |
Series.size | 返回元素的个数 |
Series.strides | return the strides of the underlying data |
Series.itemsize | return the size of the dtype of the item of the underlying data |
Series.base | return the base object if the memory of the underlying data is |
Series.T | 返回转置 |
Series.memory_usage([index, deep]) | Memory usage of the Series |
方法 | 描述 |
---|---|
Series.astype(dtype[, copy, raise_on_error]) | Cast object to input numpy.dtype |
Series.copy([deep]) | 复制Series |
Series.isnull() | 测定是null,返回布尔值 |
Series.notnull() | 测定不是null,返回布尔值 |
方法 | 描述 |
---|---|
Series.get(key[, default]) | 返回所要得到的值 |
Series.at | 快速的标量访问器,使用标签 |
Series.iat | 快速的标量访问器,使用整型 |
Series.ix | 只能快速访问器,先使用标签,再使用整型 |
Series.loc | 标签索引 |
Series.iloc | 整型索引 |
Series.iter() | 序列值迭代器 |
Series.iteritems() | 惰性迭代器,返回索引和值 |
方法 | 描述 |
---|---|
Series.add(other[, level, fill_value, axis]) | 加法,元素指向 |
Series.sub(other[, level, fill_value, axis]) | 减法,元素指向 |
Series.mul(other[, level, fill_value, axis]) | 乘法,元素指向 |
Series.div(other[, level, fill_value, axis]) | 除法,元素指向,结果为浮点 |
Series.truediv(other[, level, fill_value, axis]) | 真除法,元素指向 |
Series.floordiv(other[, level, fill_value, axis]) | 向下取整除法,元素指向 |
Series.mod(other[, level, fill_value, axis]) | 模运算,元素指向 |
Series.pow(other[, level, fill_value, axis]) | 幂运算,元素指向 |
Series.radd(other[, level, fill_value, axis]) | 右侧加法,元素指向 |
Series.rsub(other[, level, fill_value, axis]) | 右侧减法,元素指向 |
Series.rmul(other[, level, fill_value, axis]) | 右侧乘法,元素指向 |
Series.rdiv(other[, level, fill_value, axis]) | 右侧除法,元素指向 |
Series.rtruediv(other[, level, fill_value, axis]) | 真右侧除法,元素指向 |
Series.rfloordiv(other[, level, fill_value, …]) | 向下取整右侧除法,元素指向 |
Series.rmod(other[, level, fill_value, axis]) | 右侧模运算,元素指向 |
Series.rpow(other[, level, fill_value, axis]) | 右侧幂运算,元素指向 |
Series.combine(other, func[, fill_value]) | Perform elementwise binary operation on two Series using given function |
Series.combine_first(other) | Combine Series values, choosing the calling Series’s values first. |
Series.round([decimals]) | 随机抽取序列的值 |
Series.lt(other[, level, fill_value, axis]) | 小于另一个序列,元素指向 |
Series.gt(other[, level, fill_value, axis]) | 大于另一个序列,元素指向 |
Series.le(other[, level, fill_value, axis]) | 小于等于另一个序列,元素指向 |
Series.ge(other[, level, fill_value, axis]) | 大于等于另一个序列,元素指向 |
Series.ne(other[, level, fill_value, axis]) | 不等于另一个序列,元素指向 |
Series.eq(other[, level, fill_value, axis]) | 等于另一个序列,元素指向 |
方法 | 描述 |
---|---|
Series.apply(func[, convert_dtype, args]) | Invoke function on values of Series. |
Series.map(arg[, na_action]) | Map values of Series using input correspondence (which can be |
Series.groupby([by, axis, level, as_index, …]) | 分组 |
Series.rolling(window[, min_periods, freq, …]) | 移动窗口 |
Series.expanding([min_periods, freq, …]) | 扩展窗口 |
Series.ewm([com, span, halflife, alpha, …]) | 指数权重窗口 |
方法 | 描述 |
---|---|
Series.abs() | 绝对值 |
Series.all([axis, bool_only, skipna, level]) | Return whether all elements are True over requested axis |
Series.any([axis, bool_only, skipna, level]) | Return whether any element is True over requested axis |
Series.autocorr([lag]) | Lag-N autocorrelation |
Series.between(left, right[, inclusive]) | Return boolean Series equivalent to left <= series <= right. |
Series.clip([lower, upper, axis]) | Trim values at input threshold(s). |
Series.clip_lower(threshold[, axis]) | Return copy of the input with values below given value(s) truncated. |
Series.clip_upper(threshold[, axis]) | Return copy of input with values above given value(s) truncated. |
Series.corr(other[, method, min_periods]) | 相关性 |
Series.count([level]) | 返回序列数据个数 |
Series.cov(other[, min_periods]) | 协方差 |
Series.cummax([axis, skipna]) | Return cumulative max over requested axis. |
Series.cummin([axis, skipna]) | Return cumulative minimum over requested axis. |
Series.cumprod([axis, skipna]) | 累乘 |
Series.cumsum([axis, skipna]) | 累加 |
Series.describe([percentiles, include, exclude]) | 描述 |
Series.diff([periods]) | 1st discrete difference of object |
Series.factorize([sort, na_sentinel]) | Encode the object as an enumerated type or categorical variable |
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() | Returns the mode(s) of the dataset. |
Series.nlargest(*args, **kwargs) | Return the largest n elements. |
Series.nsmallest(*args, **kwargs) | Return the smallest n elements. |
Series.pct_change([periods, fill_method, …]) | 增长率 |
Series.prod([axis, skipna, level, numeric_only]) | 乘积 |
Series.quantile([q, interpolation]) | 分位数 |
Series.rank([axis, method, numeric_only, …]) | 排名 |
Series.sem([axis, skipna, level, ddof, …]) | Return unbiased standard error of the mean over requested axis. |
Series.skew([axis, skipna, level, numeric_only]) | 偏度 |
Series.std([axis, skipna, level, ddof, …]) | 标准差 |
Series.sum([axis, skipna, level, numeric_only]) | 求和 |
Series.var([axis, skipna, level, ddof, …]) | 方差 |
Series.unique() | 返回唯一值 |
Series.nunique([dropna]) | R返回唯一值的个数 |
Series.is_unique | 是否为唯一值 |
Series.is_monotonic | Return boolean if values in the object are |
Series.is_monotonic_increasing | Return boolean if values in the object are |
Series.is_monotonic_decreasing | Return boolean if values in the object are |
Series.value_counts([normalize, sort, …]) | 唯一值计数 |
方法 | 描述 |
---|---|
Series.align(other[, join, axis, level, …]) | Align two object on their axes with the |
Series.drop(labels[, axis, level, inplace, …]) | 返回移除的数据 |
Series.drop_duplicates(*args, **kwargs) | Return Series with duplicate values removed |
Series.duplicated(*args, **kwargs) | Return boolean Series denoting duplicate values |
Series.equals(other) | 是否含有相同的元素 |
Series.first(offset) | Convenience method for subsetting initial periods of time series data based on a date offset. |
Series.head([n]) | 返回前n行 |
Series.idxmax([axis, skipna]) | Index of first occurrence of maximum of values. |
Series.idxmin([axis, skipna]) | 返回最小值的索引 |
Series.isin(values) | 是否包含序列的元素 |
Series.last(offset) | Convenience method for subsetting final periods of time series data based on a date offset. |
Series.reindex([index]) | Conform Series to new index with optional filling logic, placing NA/NaN in locations having no value in the previous index. |
Series.reindex_like(other[, method, copy, …]) | Return an object with matching indices to myself. |
Series.rename([index]) | Alter axes input function or functions. |
Series.rename_axis(mapper[, axis, copy, inplace]) | Alter index and / or columns using input function or functions. |
Series.reset_index([level, drop, name, inplace]) | Analogous to the pandas.DataFrame.reset_index() function, see docstring there. |
Series.sample([n, frac, replace, weights, …]) | 随机抽样 |
Series.select(crit[, axis]) | Return data corresponding to axis labels matching criteria |
Series.take(indices[, axis, convert, is_copy]) | return Series corresponding to requested indices |
Series.tail([n]) | 返回最后几行 |
Series.truncate([before, after, axis, copy]) | Truncates a sorted NDFrame before and/or after some particular index value. |
Series.where(cond[, other, inplace, axis, …]) | 条件选择 |
Series.mask(cond[, other, inplace, axis, …]) | Return an object of same shape as self and whose corresponding entries are from self where cond is False and otherwise are from other. |
方法 | 描述 |
---|---|
Series.dropna([axis, inplace]) | 返回没有缺失值的序列 |
Series.fillna([value, method, axis, …]) | 填充缺失值 |
Series.interpolate([method, axis, limit, …]) | Interpolate values according to different methods. |
方法 | 描述 |
---|---|
Series.argsort([axis, kind, order]) | Overrides ndarray.argsort. |
Series.reorder_levels(order) | Rearrange index levels using input order. |
Series.sort_values([axis, ascending, …]) | Sort by the values along either axis |
Series.sort_index([axis, level, ascending, …]) | Sort object by labels (along an axis) |
Series.sortlevel([level, ascending, …]) | Sort Series with MultiIndex by chosen level. |
Series.swaplevel([i, j, copy]) | Swap levels i and j in a MultiIndex |
Series.unstack([level, fill_value]) | Unstack, a.k.a. |
Series.searchsorted(v[, side, sorter]) | Find indices where elements should be inserted to maintain order. |
方法 | 描述 |
---|---|
Series.append(to_append[, ignore_index, …]) | Concatenate two or more Series. |
Series.replace([to_replace, value, inplace, …]) | Replace values given in ‘to_replace’ with ‘value’. |
Series.update(other) | Modify Series in place using non-NA values from passed Series. |
方法 | 描述 |
---|---|
Series.asfreq(freq[, method, how, normalize]) | 将时间序列转换为特定的频率 |
Series.asof(where[, subset]) | The last row without any NaN is taken (or the last row without |
Series.shift([periods, freq, axis]) | Shift index by desired number of periods with an optional time freq |
Series.first_valid_index() | Return label for first non-NA/null value |
Series.last_valid_index() | Return label for last non-NA/null value |
Series.resample(rule[, how, axis, …]) | Convenience method for frequency conversion and resampling of time series. |
Series.tz_convert(tz[, axis, level, copy]) | Convert tz-aware axis to target time zone. |
Series.tz_localize(*args, **kwargs) | Localize tz-naive TimeSeries to target time zone. |
方法 | 描述 |
---|---|
Series.dt.date | Returns numpy array of python datetime.date objects (namely, the date part of Timestamps without timezone information). |
Series.dt.time | Returns numpy array of datetime.time. |
Series.dt.year | 返回年份 |
Series.dt.month | 返回月份 |
Series.dt.day | 返回天 |
Series.dt.hour | 返回小时 |
Series.dt.minute | 返回分钟 |
Series.dt.second | 返回秒 |
Series.dt.microsecond | 返回微秒 |
Series.dt.nanosecond | 返回纳秒 |
Series.dt.week | 返回周在年份中的名次 |
Series.dt.weekofyear | 返回周在年份中的名次 |
Series.dt.dayofweek | 返回日在周中的名次 Monday=0, Sunday=6 |
Series.dt.weekday | 返回日在周中的名次Monday=0, Sunday=6 |
Series.dt.weekday_name | 返回周中日的名字 (ex: Friday) |
Series.dt.dayofyear | 返回日在年中的名次 |
Series.dt.quarter | 季度 |
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 | Logical indicating if the date belongs to a leap year |
Series.dt.daysinmonth | 月份一共有多少天 |
Series.dt.days_in_month | 月份一共有多少天 |
Series.dt.freq | get/set the frequncy of the Index |
方法 | 描述 |
---|---|
Series.dt.to_period(*args, **kwargs) | Cast to PeriodIndex at a particular frequency |
Series.dt.to_pydatetime() | |
Series.dt.tz_localize(*args, **kwargs) | Localize tz-naive DatetimeIndex to given time zone (using |
Series.dt.tz_convert(*args, **kwargs) | Convert tz-aware DatetimeIndex from one time zone to another (using |
Series.dt.normalize(*args, **kwargs) | Return DatetimeIndex with times to midnight. |
Series.dt.strftime(*args, **kwargs) | Return an array of formatted strings specified by date_format, which supports the same string format as the python standard library. |
Series.dt.round(*args, **kwargs) | round the index to the specified freq |
Series.dt.floor(*args, **kwargs) | floor the index to the specified freq |
Series.dt.ceil(*args, **kwargs) | ceil the index to the specified freq |
方法 | 描述 |
---|---|
Series.dt.days | Number of days for each element. |
Series.dt.seconds | Number of seconds (>= 0 and less than 1 day) for each element. |
Series.dt.microseconds | Number of microseconds (>= 0 and less than 1 second) for each element. |
Series.dt.nanoseconds | Number of nanoseconds (>= 0 and less than 1 microsecond) for each element. |
Series.dt.components | Return a dataframe of the components (days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds) of the Timedeltas. |
方法 | 描述 |
---|---|
Series.dt.to_pytimedelta() | |
Series.dt.total_seconds(*args, **kwargs) | Total duration of each element expressed in seconds. |
方法 | 描述 |
---|---|
Series.str.capitalize() | 首字母大写 |
Series.str.cat([others, sep, na_rep]) | 连接字符串 |
Series.str.center(width[, fillchar]) | Filling left and right side of strings in the Series/Index with an additional character. |
Series.str.contains(pat[, case, flags, na, …]) | 是否包含 |
Series.str.count(pat[, flags]) | Count occurrences of pattern in each string of the Series/Index. |
Series.str.decode(encoding[, errors]) | Decode character string in the Series/Index using indicated encoding. |
Series.str.encode(encoding[, errors]) | Encode character string in the Series/Index using indicated encoding. |
Series.str.endswith(pat[, na]) | 是否以…结尾 |
Series.str.extract(pat[, flags, expand]) | For each subject string in the Series, extract groups from the first match of regular expression pat. |
Series.str.extractall(pat[, flags]) | For each subject string in the Series, extract groups from all matches of regular expression pat. |
Series.str.find(sub[, start, end]) | Return lowest indexes in each strings in the Series/Index where the substring is fully contained between [start:end]. |
Series.str.findall(pat[, flags]) | Find all occurrences of pattern or regular expression in the Series/Index. |
Series.str.get(i) | Extract element from lists, tuples, or strings in each element in the Series/Index. |
Series.str.index(sub[, start, end]) | Return lowest indexes in each strings where the substring is fully contained between [start:end]. |
Series.str.join(sep) | Join lists contained as elements in the Series/Index with passed delimiter. |
Series.str.len() | 计算所有的长度 |
Series.str.ljust(width[, fillchar]) | Filling right side of strings in the Series/Index with an additional character. |
Series.str.lower() | 小写 |
Series.str.lstrip([to_strip]) | Strip whitespace (including newlines) from each string in the Series/Index from left side. |
Series.str.normalize(form) | Return the Unicode normal form for the strings in the Series/Index. |
Series.str.pad(width[, side, fillchar]) | Pad strings in the Series/Index with an additional character to specified side. |
Series.str.partition([pat, expand]) | Split the string at the first occurrence of sep, and return 3 elements containing the part before the separator, the separator itself, and the part after the separator. |
Series.str.repeat(repeats) | Duplicate each string in the Series/Index by indicated number of times. |
Series.str.replace(pat, repl[, n, case, flags]) | 替换 |
Series.str.rfind(sub[, start, end]) | Return highest indexes in each strings in the Series/Index where the substring is fully contained between [start:end]. |
Series.str.rindex(sub[, start, end]) | Return highest indexes in each strings where the substring is fully contained between [start:end]. |
Series.str.rjust(width[, fillchar]) | Filling left side of strings in the Series/Index with an additional character. |
Series.str.rpartition([pat, expand]) | Split the string at the last occurrence of sep, and return 3 elements containing the part before the separator, the separator itself, and the part after the separator. |
Series.str.rstrip([to_strip]) | Strip whitespace (including newlines) from each string in the Series/Index from right side. |
Series.str.slice([start, stop, step]) | Slice substrings from each element in the Series/Index |
Series.str.slice_replace([start, stop, repl]) | Replace a slice of each string in the Series/Index with another string. |
Series.str.split([pat, n, expand]) | 分割字符串 |
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(table[, deletechars]) | 根据映射表翻译 |
Series.str.upper() | 全部大写 |
Series.str.wrap(width, **kwargs) | Wrap long strings in the Series/Index to be formatted in paragraphs with length less than a given width. |
Series.str.zfill(width) | Filling left side of strings in the Series/Index with 0. |
Series.str.isalnum() | 是否是个数字 |
Series.str.isalpha() | 是否是个字母 |
Series.str.isdigit() | Check whether all characters in each string in the Series/Index are digits. |
Series.str.isspace() | 是否是空白 |
Series.str.islower() | 是否是小写 |
Series.str.isupper() | 是否是大学 |
Series.str.istitle() | 首字母大写 |
Series.str.isnumeric() | 数字 |
Series.str.isdecimal() | 小数 |
Series.str.get_dummies([sep]) | Split each string in the Series by sep and return a frame of dummy/indicator variables. |
方法 | 描述 |
---|---|
Series.cat.categories | The categories of this categorical. |
Series.cat.ordered | Gets the ordered attribute |
Series.cat.codes | |
Series.cat.rename_categories(*args, **kwargs) | Renames categories. |
Series.cat.reorder_categories(*args, **kwargs) | Reorders categories as specified in new_categories. |
Series.cat.add_categories(*args, **kwargs) | Add new categories. |
Series.cat.remove_categories(*args, **kwargs) | Removes the specified categories. |
Series.cat.remove_unused_categories(*args, …) | Removes categories which are not used. |
Series.cat.set_categories(*args, **kwargs) | Sets the categories to the specified new_categories. |
Series.cat.as_ordered(*args, **kwargs) | Sets the Categorical to be ordered |
Series.cat.as_unordered(*args, **kwargs) | Sets the Categorical to be unordered |
Categorical(values[, categories, ordered, …]) | Represents a categorical variable in classic R / S-plus fashion |
Categorical.from_codes(codes, categories[, …]) | Make a Categorical type from codes and categories arrays. |
方法 | 描述 |
---|---|
Series.plot([kind, ax, figsize, ….]) | Series plotting accessor and method |
Series.plot.area(**kwds) | 面积图Area plot |
Series.plot.bar(**kwds) | 垂直条形图Vertical bar plot |
Series.plot.barh(**kwds) | 水平条形图Horizontal bar plot |
Series.plot.box(**kwds) | 箱图Boxplot |
Series.plot.density(**kwds) | 核密度Kernel Density Estimate plot |
Series.plot.hist([bins]) | 直方图Histogram |
Series.plot.kde(**kwds) | 核密度Kernel Density Estimate plot |
Series.plot.line(**kwds) | 线图Line plot |
Series.plot.pie(**kwds) | 饼图Pie chart |
Series.hist([by, ax, grid, xlabelsize, …]) | Draw histogram of the input series using matplotlib |
方法 | 描述 |
---|---|
Series.from_csv(path[, sep, parse_dates, …]) | Read CSV file (DEPRECATED, please use pandas.read_csv()instead). |
Series.to_pickle(path[, compression, protocol]) | Pickle (serialize) object to input file path. |
Series.to_csv([path, index, sep, na_rep, …]) | Write Series to a comma-separated values (csv) file |
Series.to_dict([into]) | Convert Series to {label -> value} dict or dict-like object. |
Series.to_excel(excel_writer[, sheet_name, …]) | Write Series to an excel sheet |
Series.to_frame([name]) | Convert Series to DataFrame |
Series.to_xarray() | Return an xarray object from the pandas object. |
Series.to_hdf(path_or_buf, key, **kwargs) | Write the contained data to an HDF5 file using HDFStore. |
Series.to_sql(name, con[, flavor, schema, …]) | Write records stored in a DataFrame to a SQL database. |
Series.to_msgpack([path_or_buf, encoding]) | msgpack (serialize) object to input file path |
Series.to_json([path_or_buf, orient, …]) | Convert the object to a JSON string. |
Series.to_sparse([kind, fill_value]) | Convert Series to SparseSeries |
Series.to_dense() | Return dense representation of NDFrame (as opposed to sparse) |
Series.to_string([buf, na_rep, …]) | Render a string representation of the Series |
Series.to_clipboard([excel, sep]) | Attempt to write text representation of object to the system clipboard This can be pasted into Excel, for example. |
Series.to_latex([buf, columns, col_space, …]) | Render an object to a tabular environment table. |