用法:
pandas.plotting.andrews_curves(frame, class_column, ax=None, samples=200, color=None, colormap=None, **kwargs)
生成 Andrews 曲線的 matplotlib 圖,用於可視化多變量數據的集群。
安德魯斯曲線具有函數形式:
x_4 sin(2t) + x_5 cos(2t) + …
f(t) = x_1/sqrt(2) + x_2 sin(t) + x_3 cos(t) +:
其中 x 係數對應於每個維度的值,並且 t 在 -pi 和 +pi 之間呈線性間隔。然後每一行框架對應於一條曲線。
- frame: DataFrame
要繪製的數據,最好歸一化為 (0.0, 1.0)。
- class_column:包含類名的列名
- ax:matplotlib 軸對象,默認無
- samples:在每條曲線中繪製的點數
- color:列表或元組,可選
用於不同類別的顏色。
- colormap:str 或 matplotlib 顏色圖對象,默認無
從中選擇顏色的顏色圖。如果是字符串,則從 matplotlib 加載具有該名稱的顏色圖。
- **kwargs:
傳遞給 matplotlib 繪圖方法的選項。
- 類:
matplotlip.axis.Axes
- 類:
參數:
返回:
例子:
>>> df = pd.read_csv( ... 'https://raw.github.com/pandas-dev/' ... 'pandas/main/pandas/tests/io/data/csv/iris.csv' ... ) >>> pd.plotting.andrews_curves(df, 'Name') <AxesSubplot:title={'center':'width'}>
相關用法
- Python pandas.plotting.autocorrelation_plot用法及代碼示例
- Python pandas.plotting.bootstrap_plot用法及代碼示例
- Python pandas.plotting.scatter_matrix用法及代碼示例
- Python pandas.plotting.radviz用法及代碼示例
- Python pandas.plotting.parallel_coordinates用法及代碼示例
- Python pandas.plotting.lag_plot用法及代碼示例
- Python pandas.plotting.boxplot用法及代碼示例
- Python pandas.pivot用法及代碼示例
- Python pandas.period_range用法及代碼示例
- Python pandas.period_range()用法及代碼示例
- Python pandas.pivot_table用法及代碼示例
- Python pandas.arrays.IntervalArray.is_empty用法及代碼示例
- Python pandas.DataFrame.ewm用法及代碼示例
- Python pandas.api.types.is_timedelta64_ns_dtype用法及代碼示例
- Python pandas.DataFrame.dot用法及代碼示例
- Python pandas.DataFrame.apply用法及代碼示例
- Python pandas.DataFrame.combine_first用法及代碼示例
- Python pandas.read_pickle用法及代碼示例
- Python pandas.Index.value_counts用法及代碼示例
- Python pandas.DatetimeTZDtype用法及代碼示例
注:本文由純淨天空篩選整理自pandas.pydata.org大神的英文原創作品 pandas.plotting.andrews_curves。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。