pandas series api catalog

#官方url:http://pandas.pydata.org/pandas-docs/stable/reference/series.htm### 目錄 ####

[1]構造函數

[2]屬性

[3]轉換

[4]索引,迭代

[5]二元運算符函數

[6]功能應用程序,GroupBy&windows

[7]計算/描述性統計

[8]重新索引/選擇/標籤操作

[9]缺少數據處理

[10]重塑,排序

[11]合併/加入/合併

[12]時間序列相關

[13]訪問者

[14]日期時間屬性

[15]分類訪問者

[16]字符串處理

[17]稀疏訪問器

[18]繪圖

[19]序列化/ IO /轉換

[20]稀疏

 

### 內容 ####

[1]構造函數

Series([data,index,dtype,name,copy,...]) 帶軸標籤的一維ndarray(包括時間序列)

[2]屬性

Series.index 系列的索引(軸標籤)。

Series.array 支持此係列或索引的數據的ExtensionArray。

Series.values 返回系列爲ndarray或ndarray-like取決於dtype。

Series.dtype 返回基礎數據的dtype對象。

Series.ftype 如果數據稀疏則返回。

Series.shape 返回基礎數據形狀的元組。

Series.nbytes 返回基礎數據中的字節數。

Series.ndim 根據定義1,基礎數據的維數。

Series.size 返回基礎數據中的元素數。

Series.strides 返回基礎數據的步幅。

Series.itemsize 返回基礎數據項的dtype大小。

Series.base 如果共享基礎數據的內存,則返回基礎對象。

Series.T 返回轉置,根據定義自我。

Series.memory_usage([index,deep]) 返回系列的內存使用情況。

Series.hasnans 如果我有任何nans,我會回來; 實現各種性能加速。

Series.flags

Series.empty

Series.dtypes 返回基礎數據的dtype對象。

Series.ftypes 如果數據稀疏則返回。

Series.data 返回基礎數據的數據指針。

Series.is_copy 退回副本。

Series.name 返回系列的名稱。

Series.put(* args,** kwargs) 將put方法應用於其values屬性(如果有)。

 

[3]轉換

Series.astype(dtype [,copy,errors]) 將pandas對象轉換爲指定的dtype dtype。

Series.infer_objects() 嘗試推斷對象列的更好的dtypes。

Series.convert_objects([convert_dates,...]) (DEPRECATED)嘗試推斷對象列的更好dtype。

Series.copy([deep]) 複製此對象的索引和數據。

Series.bool() 返回單個元素PandasObject的bool。

Series.to_numpy([dtype,copy]) NumPy ndarray表示此係列或索引中的值。

Series.to_period([freq,copy]) 將Series從DatetimeIndex轉換爲具有所需頻率的PeriodIndex(如果未傳遞則從索引推斷)。

Series.to_timestamp([freq,how,copy]) 在期間開始時轉換爲時間戳的datetimedex 。

Series.to_list() 返回值列表。

Series.get_values() 與values相同(但處理稀疏轉換); 是一種觀點。

Series.__array__([dtype]) 將值作爲NumPy數組返回。

 

[4]索引,迭代

Series.get() 從給定鍵的對象獲取項目(DataFrame列,Panel切片等)。

Series.at 訪問行/列標籤對的單個值。

Series.iat 按整數位置訪問行/列對的單個值。

Series.loc 按標籤或布爾數組訪問一組行和列。

Series.iloc 純粹基於整數位置的索引,用於按位置選擇。

Series.__iter__() 返回值的迭代器。

Series.iteritems() 懶惰地迭代(索引,值)元組。

Series.items() 懶惰地迭代(索引,值)元組。

Series.keys() 索引的別名。

Series.pop(item) 返回項目並從框架中刪除。

Series.item() 將基礎數據的第一個元素作爲python標量返回。

Series.xs(key[,axis,level,drop_level]) 返回Series/DataFrame的橫截面。

 

[5]二元運算符函數

Series.add(other[,level,fill_value,axis]) 添加series和other元素(二元運算符添加)。

Series.sub(other[,level,fill_value,axis]) 減去序列和other元素(二元運算符子)。

Series.mul(other[,level,fill_value,axis]) series和other的乘法,元素(二元運算符mul)。

Series.div(other[,level,fill_value,axis]) 浮動分裂series和other,元素方式(二元運算符truediv)。

Series.truediv(other[,level,fill_value,axis]) 浮動分裂series和other,元素方式(二元運算符truediv)。

Series.floordiv(other[,level,fill_value,axis]) series和other的整數除法,元素方式(二元運算符floordiv)。

Series.mod(other[,level,fill_value,axis]) series和other的模數,元素方式(二元運算符mod)。

Series.pow(other[,level,fill_value,axis]) series和other元素的指數冪(二元運算符pow)。

Series.radd(other[,level,fill_value,axis]) 添加series和other元素(二元運算符radd)。

Series.rsub(other[,level,fill_value,axis]) series和other元素的減法(二元運算符rsub)。

Series.rmul(other[,level,fill_value,axis]) series和other的乘法,元素(二元運算符rmul)。

Series.rdiv(other[,level,fill_value,axis]) series和other的浮動劃分,元素方式(二元算子rtruediv)。

Series.rtruediv(other[,level,fill_value,axis]) series和other的浮動劃分,元素方式(二元算子rtruediv)。

Series.rfloordiv(other[,level,fill_value,...]) series和other的整數除法,元素方式(二元算子rfloordiv)。

Series.rmod(other[,level,fill_value,axis]) series和other的模數,元素方式(二元運算符rmod)。

Series.rpow(other[,level,fill_value,axis]) series和other元素的指數冪(二元運算符rpow)。

Series.combine(other,func [,fill_value]) 根據功能將series與series或標量組合。

Series.combine_first(other) 組合series值,首先選擇調用series的值。

Series.round([decimals]) 將series中的每個值舍入到給定的小數位數。

Series.lt(other[,level,fill_value,axis]) 少於series和other元素(二元運算符lt)。

Series.gt(other[,level,fill_value,axis]) 大於series和other元素(二元運算符gt)。

Series.le(other[,level,fill_value,axis]) 小於或等於series和other元素(二元運算符le)。

Series.ge(other[,level,fill_value,axis]) 大於或等於series和other元素(二元運算符ge)。

Series.ne(other[,level,fill_value,axis]) 不等於series和other元素(二元運算符ne)。

Series.eq(other[,level,fill_value,axis]) 等於series和other元素(二元運算符eq)。

Series.product([axis,skipna,level,...]) 返回請求軸的值的乘積。

Series.dot(other) 計算series和other列之間的點積

 

[6]功能應用程序,GroupBy&windows

Series.apply(func [,convert_dtype,args]) 調用Series的值的函數。

Series.agg(func [,axis]) 使用指定軸上的一個或多個操作進行聚合。

Series.aggregate(func [,axis]) 使用指定軸上的一個或多個操作進行聚合。

Series.transform(func [,axis]) 調用func自生成具有變換值的系列並且具有與self相同的軸長度。

Series.map(arg [,na_action]) 根據輸入的對應關係映射系列的值。

Series.groupby([by,axis,level,as_index,...]) 使用映射器或一系列列對DataFrame或Series進行分組。

Series.rolling(window [,min_periods,...]) 提供滾動窗口計算。

Series.expanding([min_periods,center,axis]) 提供擴展轉換。

Series.ewm([com,span,halflife,alpha,...]) 提供指數加權函數。

Series.pipe(func,*args,**kwargs) 應用func(self,* args,** kwargs)。

 

[7]計算/描述性統計

Series.abs() 返回具有每個元素的絕對數值的Series/DataFrame。

Series.all([axis,bool_only,skipna,level]) 返回是否所有元素都是True,可能是在axis上。

Series.any([axis,bool_only,skipna,level]) 返回任何元素是否爲True,可能是在axis上。

Series.autocorr([lag]) 計算lag-N自相關。

Series.between(left,right[,inclusive]) 返回布爾值系列等效於左<=系列<=右。

Series.clip([lower,upper,axis,inplace]) 在輸入threshold處修剪值。

Series.clip_lower(threshold[,axis,inplace]) (已棄用)修剪低於給定threshold的值。

Series.clip_upper(threshold[,axis,inplace]) (已棄用)修剪高於給定threshold的值。

Series.corr(other[,method,min_periods]) 計算與other系列的相關性,不包括缺失值。

Series.count([level]) 返回系列中非NA/null觀測值的返回數。

Series.cov(other[,min_periods]) 計算與Series的協方差,不包括缺失值。

Series.cummax([axis,skipna]) 返回DataFrame或Seriesaxis上的累積最大值。

Series.cummin([axis,skipna]) 返回DataFrame或Seriesaxis上的累積最小值。

Series.cumprod([axis,skipna]) 通過DataFrame或Seriesaxis返回累積產品。

Series.cumsum([axis,skipna]) 返回DataFrame或Seriesaxis上的累積和。

Series.describe([percentiles, include, exclude]) 生成描述性統計數據,總結數據集分佈的集中趨勢,分散和形狀,不包括NaN值。

Series.diff([periods]) 第一個離散的元素差異。

Series.factorize([sort,na_sentinel]) 將對象編碼爲枚舉類型或分類變量。

Series.kurt([axis,skipna,level,numeric_only]) 使用Fisher對峯度的定義(正常峯度== 0.0),在請求的axis上返回無偏峯度。

Series.mad([axis,skipna,level]) 返回請求axis的值的平均絕對偏差。

Series.max([axis,skipna,level,numeric_only]) 返回請求axis的最大值。

Series.mean([axis,skipna,level,numeric_only]) 返回請求axis的值的平均值。

Series.median([axis,skipna,level,...]) 返回請求axis的值的中值。

Series.min([axis,skipna,level,numeric_only]) 返回請求axis的最小值。

Series.mode([dropna]) 返回數據集的模式。

Series.nlargest([n,keep]) 返回最大的n個元素。

Series.nsmallest([n,keep]) 返回最小的n個元素。

Series.pct_change([periods,fill_method,...]) 當前元素和先前元素之間的百分比變化。

Series.prod([axis,skipna,level,...]) 返回請求axis的值的乘積。

Series.quantile([q,interpolation]) 給定分位數處的返回值。

Series.rank([axis,method,numeric_only,...]) 沿axis計算數值數據level(1到n)。

Series.sem([axis,skipna,level,ddof,...]) 在請求的axis上返回均值的無偏標準誤差。

Series.skew([axis,skipna,level,numeric_only]) 返回請求axis的無偏偏差,由N-1歸一化。

Series.std([axis,skipna,level,ddof,...]) 返回請求axis上的樣本標準偏差。

Series.sum([axis,skipna,level,...]) 返回請求axis的值的總和。

Series.var([axis,skipna,level,ddof,...]) 在請求的axis上返回無偏差異。

Series.kurtosis([axis,skipna,level,...]) 使用Fisher對峯度的定義(正常峯度== 0.0),在請求的axis上返回無偏峯度。

Series.unique() 返回Series對象的唯一值。

Series.nunique([dropna]) 返回對象中唯一元素的數量。

Series.is_unique 如果對象中的值是唯一的,則返回布爾值。

Series.is_monotonic 如果對象中的值是monotonic_increasing,則返回boolean。

Series.is_monotonic_increasing 如果對象中的值是monotonic_increasing,則返回boolean。

Series.is_monotonic_decreasing 如果對象中的值是monotonic_decreasing,則返回布爾值。

Series.value_counts([normalize,sort,...]) 返回包含唯一值計數的系列。

Series.compound([axis,skipna,level]) 返回請求axis的值的複合百分比。

 

[8]重新索引/選擇/標籤操作

Series.align(other[, join, axis, level, …]) 使用指定的每個軸索引的連接方法將軸上的兩個對象對齊。

Series.drop([labels, axis, index, columns, …]) 返回已刪除指定索引標籤的series。

Series.droplevel(level[, axis]) 返回DataFrame,刪除請求的索引/列級別。

Series.drop_duplicates([keep, inplace]) 返回系列,刪除重複值。

Series.duplicated([keep]) 指示重複的系列值。

Series.equals(other) 測試兩個對象是否包含相同的元素。

Series.first(offset) 基於日期偏移量對初始時間序列數據的子集進行子集化的便捷方法。

Series.head([n]) 返回前n行。

Series.idxmax([axis, skipna]) 返回最大值的行標籤。

Series.idxmin([axis, skipna]) 返回最小值的行標籤。

Series.isin(values) 檢查series中是否包含值。

Series.last(offset) 基於日期偏移量化時間序列數據的最終時段的便捷方法。

Series.reindex([index]) 使用可選填充邏輯將系列符合到新索引,將NA/NaN放置在先前索引中沒有值的位置。

Series.reindex_like(other[, method, copy, …]) 返回具有匹配索引的對象作爲其他對象。

Series.rename([index]) 更改series索引標籤或名稱。

Series.rename_axis([mapper, index, columns, …]) 設置索引或列的軸名稱。

Series.reset_index([level, drop, name, inplace]) 使用索引重置生成新的DataFrame或Series。

Series.sample([n, frac, replace, weights, …]) 從對象軸返回隨機的項目樣本。

Series.select(crit[, axis]) (DEPRECATED)返回與軸標籤匹配條件對應的數據。

Series.set_axis(labels[, axis, inplace]) 將所需索引分配給給定軸。

Series.take(indices[, axis, convert, is_copy]) 沿軸返回給定位置索引中的元素。

Series.tail([n]) 返回最後n行。

Series.truncate([before, after, axis, copy]) 在某個索引值之前和之後截斷一個Series或DataFrame。

Series.where(cond[, other, inplace, axis, …]) 替換條件爲False的值。

Series.mask(cond[, other, inplace, axis, …]) 替換條件爲True的值。

Series.add_prefix(prefix) 帶有字符串前綴的前綴標籤。

Series.add_suffix(suffix) 帶有字符串後綴的後綴標籤。

Series.filter([items, like, regex, axis]) 根據指定索引中的標籤設置數據框的行或列。

 

[9]缺少數據處理

Series.isna() 檢測缺失值。

Series.notna() 檢測現有(非缺失)值。

Series.dropna([axis, inplace]) 返回刪除了缺失值的新Series。

Series.fillna([value, method, axis, …]) 使用指定的方法填充NA / NaN值。

Series.interpolate([method, axis, limit, …]) 根據不同的方法插值。

 

[10]重塑,排序

Series.argsort([axis, kind, order]) 覆蓋ndarray.argsort。

Series.argmin([axis, skipna]) (DEPRECATED)返回最小值的行標籤。

Series.argmax([axis, skipna]) (DEPRECATED)返回最大值的行標籤。

Series.reorder_levels(order) 使用輸入順序重新排列索引級別。

Series.sort_values([axis, ascending, …]) 按值排序。

Series.sort_index([axis, level, ascending, …]) 按索引標籤排序系列。

Series.swaplevel([i, j, copy]) 在MultiIndex中交換i和j級別。

Series.unstack([level, fill_value]) Unstack,又名

Series.searchsorted(value[, side, sorter]) 查找應插入元素以維護順序的索引。

Series.ravel([order]) 將展平的底層數據作爲ndarray返回。

Series.repeat(repeats[, axis]) 重複系列的元素。

Series.squeeze([axis]) 將1維軸對象壓縮爲標量。

Series.view([dtype]) 創建系列的新視圖。

 

[11]合併/加入/合併

Series.append(to_append [,ignore_index,...]) 連接兩個或更多系列。

Series.replace([to_replace,value,inplace,...]) 替換給定的值to_replace與價值。

Series.update(other) 使用傳遞的Series中的非NA值修改系列。

 

[12]時間序列相關

Series.asfreq(freq[, method, how, …]) 將TimeSeries轉換爲指定的頻率。

Series.asof(where[, subset]) 返回前最後一行(S)沒有任何NaN的地方。

Series.shift([periods, freq, axis, fill_value]) 使用可選的時間頻率按期望的週期數移動索引。

Series.first_valid_index() 返回第一個非NA / null值的索引。

Series.last_valid_index() 返回最後一個非NA / null值的索引。

Series.resample(rule[, how, axis, …]) 重新採樣時間序列數據。

Series.tz_convert(tz[, axis, level, copy]) 將tz感知軸轉換爲目標時區。

Series.tz_localize(tz[, axis, level, copy, …]) 將Series或DataFrame的tz-naive索引本地化爲目標時區

Series.at_time(time[, asof, axis]) 在特定時間選擇值(例如,

Series.between_time(start_time, end_time[, …]) 選擇一天中特定時間之間的值(例如,上午9:00-9:30)。

Series.tshift([periods, freq, axis]) 使用索引的頻率(如果可用)移動時間索引。

Series.slice_shift([periods, axis]) 相當於移位而不復制數據。

 

[13]訪問者

Pandas在各種訪問器下提供特定於dtype的方法。這些是單獨的命名空間Series,僅適用於特定的數據類型。

 

數據類型 訪問

Data Type    Accessor

Datetime,Timedelta,Period    dt

String   str

Categorical  cat

Sparse   sparse

 

[14]日期時間屬性

Series.dt.date 返回python datetime.date對象的numpy數組(即沒有時區信息的Timestamps的日期部分)。

Series.dt.time 返回datetime.time的numpy數組。

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 一年中的一週序數。

Series.dt.weekofyear 一年中的一週序數。

Series.dt.dayofweek 星期一= 0,星期日= 6的星期幾。

Series.dt.weekday 星期一= 0,星期日= 6的星期幾。

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 布爾指示符,如果日期屬於閏年。

Series.dt.daysinmonth 這個月的天數。

Series.dt.days_in_month 這個月的天數。

Series.dt.tz 返回時區,如果有的話。

Series.dt.freq

 

日期時間方法

Series.dt.to_period(*args, **kwargs) 以特定頻率轉換爲PeriodArray / Index。

Series.dt.to_pydatetime() 將數據作爲本機Python日期時間對象的數組返回。

Series.dt.tz_localize(*args, **kwargs) 將tz-naive日期時間數組/索引本地化爲tz感知日期時間數

Series.dt.tz_convert(*args, **kwargs) 將tz感知日期時間數組/索引從一個時區轉換爲另一個時區。

Series.dt.normalize(*args, **kwargs) 將時間轉換爲午夜。

Series.dt.strftime(*args, **kwargs) 使用指定的date_format轉換爲Index。

Series.dt.round(*args, **kwargs) 對數據執行循環操作到指定的頻率。

Series.dt.floor(*args, **kwargs) 對指定頻率的數據執行floor操作。

Series.dt.ceil(*args, **kwargs) 對數據執行ceil操作到指定的頻率。

Series.dt.month_name(*args, **kwargs) 返回具有指定語言環境的DateTimeIndex的月份名稱。

Series.dt.day_name(*args, **kwargs) 返回具有指定語言環境的DateTimeIndex的日期名稱。

 

期間屬性

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組件的Dataframe。

 

Timedelta方法

Series.dt.to_pytimedelta() 返回本機datetime.timedelta對象的數組。

Series.dt.total_seconds(* args,** kwargs) 返回每個元素的總持續時間,以秒爲單位。

 

[15]分類訪問者

Series.cat 訪問者可以使用Categorical-dtype特定的方法和屬性。

Series.cat.categories 這種分類的類別。

Series.cat.ordered 類別是否具有有序關係。

Series.cat.codes 返回代碼系列以及索引。

Series.cat.rename_categories(* args,** kwargs) 重命名類別。

Series.cat.reorder_categories(* args,** kwargs) 重新排序new_categories中指定的類別。

Series.cat.add_categories(* args,** kwargs) 添加新類別。

Series.cat.remove_categories(* args,** kwargs) 刪除指定的類別。

Series.cat.remove_unused_categories(* args,......) 刪除未使用的類別。

Series.cat.set_categories(* args,** kwargs) 將類別設置爲指定的new_categories。

Series.cat.as_ordered(* args,** kwargs) 設置要訂購的分類。

Series.cat.as_unordered(* args,** kwargs) 將Categorical設置爲無序。


 

[16]字符串處理

Series.str.capitalize() 將Series / Index中的字符串轉換爲大寫。

Series.str.cat([others, sep, na_rep, join]) 使用給定的分隔符連接Series / Index中的字符串。

Series.str.center(width[, fillchar]) 使用附加字符填充系列/索引中字符串的左側和右側。

Series.str.contains(pat[, case, flags, na, …]) 測試pattern或regex是否包含在Series或Index的字符串中。

Series.str.count(pat[, flags]) 計算系列/索引的每個字符串中模式的出現次數。

Series.str.decode(encoding[, errors]) 使用指定的編碼解碼系列/索引中的字符串。

Series.str.encode(encoding[, errors]) 使用指定的編碼對系列/索引中的字符串進行編碼。

Series.str.endswith(pat[, na]) 測試每個字符串元素的結尾是否與模式匹配。

Series.str.extract(pat[, flags, expand]) 提取的正則表達式捕獲組拍作爲一個數據幀列。

Series.str.extractall(pat[, flags]) 對於系列中的每個主題字符串,從正則表達式pat的所有匹配中提取組。

Series.str.find(sub[, start, end]) 返回Series / Index中每個字符串中的最低索引,其中子字符串完全包含在[start:end]之間。

Series.str.findall(pat[, flags]) 在系列/索引中查找所有出現的模式或正則表達式。

Series.str.get(i) 從指定位置的每個組件中提取元素。

Series.str.index(sub[, start, end]) 返回子字符串完全包含在[start:end]之間的每個字符串中的最低索引。

Series.str.join(sep) 使用傳遞的分隔符連接包含在Series / Index中的元素的列表。

Series.str.len() 計算Series / Index中每個元素的長度。

Series.str.ljust(width[, fillchar]) 使用附加字符填充系列/索引中字符串的右側。

Series.str.lower() 將Series / Index中的字符串轉換爲小寫。

Series.str.lstrip([to_strip]) 刪除前導和尾隨字符。

Series.str.match(pat[, case, flags, na]) 確定每個字符串是否與正則表達式匹配。

Series.str.normalize(form) 返回Series / Index中字符串的Unicode普通表單。

Series.str.pad(width[, side, fillchar]) 將系列/索引中的字符串填充到寬度。

Series.str.partition([sep, expand]) 在第一次出現sep時拆分字符串。

Series.str.repeat(repeats) 複製系列或索引中的每個字符串。

Series.str.replace(pat, repl[, n, case, …]) 用一些其他字符串替換Series / Index中出現的pattern / regex。

Series.str.rfind(sub[, start, end]) 返回Series / Index中每個字符串中的最高索引,其中子字符串完全包含在[start:end]之間。

Series.str.rindex(sub[, start, end]) 返回每個字符串中的最高索引,其中子字符串完全包含在[start:end]之間。

Series.str.rjust(width[, 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]) 在給定的分隔符/分隔符周圍拆分字符串。

Series.str.rsplit([pat, n, expand]) 在給定的分隔符/分隔符周圍拆分字符串。

Series.str.startswith(pat[, na]) 測試每個字符串元素的開頭是否與模式匹配。

Series.str.strip([to_strip]) 刪除前導和尾隨字符。

Series.str.swapcase() 將Series / Index中的字符串轉換爲swapcased。

Series.str.title() 將系列/索引中的字符串轉換爲標題。

Series.str.translate(table[, deletechars]) 通過給定的映射表映射字符串中的所有字符。

Series.str.upper() 將Series / Index中的字符串轉換爲大寫。

Series.str.wrap(width, **kwargs) 將Series / Index中的長字符串換行,以長度小於給定寬度的段落進行格式化。

Series.str.zfill(width) 系列/索引中的字符串填充前綴爲'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]) 用sep拆分Series中的每個字符串,並返回一個虛擬/指示變量框。

 

[17]稀疏訪問器

Series.sparse.npoints 非fill_value點數。

Series.sparse.density 非fill_value點的百分比,以十進制表示。

Series.sparse.fill_value 不存儲fill_value 數據中的元素。

Series.sparse.sp_values 包含非fill_value值的ndarray 。

Series.sparse.from_coo(A [,dense_index]) 從scipy.sparse.coo_matrix創建SparseSeries。

Series.sparse.to_coo([row_levels,...]) 使用MultiIndex從SparseSeries創建scipy.sparse.coo_matrix。

 

[18]繪圖

Series.plot([kind, ax, figsize, ….]) 系列繪圖訪問器和方法

Series.plot.area(** kwds) 區域情節。

Series.plot.bar(** kwds) 垂直條形圖。

Series.plot.barh(** kwds) 單槓圖。

Series.plot.box(** kwds) 箱形圖。

Series.plot.density([bw_method,ind]) 使用高斯核生成核密度估計圖。

Series.plot.hist([bins]) 直方圖。

Series.plot.kde([bw_method,ind]) 使用高斯核生成核密度估計圖。

Series.plot.line(** kwds) 線圖。

Series.plot.pie(** kwds) 餅形圖。

Series.hist([by,ax,grid,xlabelsize,...]) 使用matplotlib繪製輸入序列的直方圖。

 

[19]序列化/ IO /轉換

Series.to_pickle(path[, compression, protocol]) Pickle(序列化)對象到文件。

Series.to_csv(*args, **kwargs) 將對象寫入逗號分隔值(csv)文件。

Series.to_dict([into]) 將Series轉換爲{label - > value} dict或類似dict的對象。

Series.to_excel(excel_writer[, sheet_name, …]) 將對象寫入Excel工作表。

Series.to_frame([name]) 將Series轉換爲DataFrame。

Series.to_xarray() 從pandas對象返回一個xarray對象。

Series.to_hdf(path_or_buf, key, **kwargs) 使用HDFStore將包含的數據寫入HDF5文件。

Series.to_sql(name, con[, schema, …]) 將存儲在DataFrame中的記錄寫入SQL數據庫。

Series.to_msgpack([path_or_buf, encoding]) 使用msgpack格式將對象序列化爲輸入文件路徑。

Series.to_json([path_or_buf, orient, …]) 將對象轉換爲JSON字符串。

Series.to_sparse([kind, fill_value]) 將Series轉換爲SparseSeries。

Series.to_dense() 返回NDFrame的密集表示(與稀疏相反)。

Series.to_string([buf, na_rep, …]) 渲染Series的字符串表示形式。

Series.to_clipboard([excel, sep]) 將對象複製到系統剪貼板。

Series.to_latex([buf, columns, col_space, …]) 將對象渲染到LaTeX表格環境表。

 

[20]稀疏

SparseSeries.to_coo([row_levels,...]) 使用MultiIndex從SparseSeries創建scipy.sparse.coo_matrix。

SparseSeries.from_coo(A [,dense_index]) 從scipy.sparse.coo_matrix創建SparseSeries。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章