原创 Python數據分析實戰【第三章】2.8-時間模塊:datetime【python】

【課程2.8】 時間模塊:datetime datetime模塊,主要掌握:datetime.date(), datetime.datetime(), datetime.timedelta() 日期解析方法:parser.pars

原创 Python數據分析實戰【第三章】2.5-Pandas數據結構Dataframe:基本概念及創建【python】

【課程2.5】 Pandas數據結構Dataframe:基本概念及創建 "二維數組"Dataframe:是一個表格型的數據結構,包含一組有序的列,其列的值類型可以是數值、字符串、布爾值等。 Dataframe中的數據以一個或多個二

原创 Python數據分析實戰【第三章】3.8-Matplotlib面積圖、填圖、餅圖【python】

【課程3.8】 面積圖、填圖、餅圖 plt.plot.area() plt.fill(), plt.fill_between() plt.pie() 1.面積圖 fig,axes = plt.subplots(2,1,figs

原创 Python數據分析實戰【第三章】3.11-Matplotlib極座標圖【python】

1.創建極座標軸 s = pd.Series(np.arange(20)) theta=np.arange(0,2*np.pi,0.02) print(s.head()) print(theta[:10]) # 創建數據 fig

原创 Python數據分析實戰【第三章】3.10-Matplotlib散點圖、矩陣散點圖【python】

【課程3.10】 散點圖、矩陣散點圖 plt.scatter(), pd.scatter_matrix() 1.plt.scatter()散點圖 # plt.scatter(x, y, s=20, c=None, marker='

原创 Python數據分析實戰【第三章】3.14-Matplotlib表格顯示控制【python】

1.按照百分數顯示 df = pd.DataFrame(np.random.randn(10,4),columns=['a','b','c','d']) print(df.head()) df.head().style.forma

原创 Python數據分析實戰【第三章】3.15-Matplotlib表格樣式調用【python】

1.定位空值 df = pd.DataFrame(np.random.rand(5,4),columns = list('ABCD')) df['A'][2] = np.nan df.style.highlight_null(nu

原创 Python數據分析實戰【第三章】3.12-Matplotlib箱型圖【python】

【課程3.12】 箱型圖 箱型圖:又稱爲盒須圖、盒式圖、盒狀圖或箱線圖,是一種用作顯示一組數據分散情況資料的統計圖 包含一組數據的:最大值、最小值、中位數、上四分位數(Q3)、下四分位數(Q1)、異常值 ① 中位數 → 一組數據平

原创 Python數據分析實戰【第三章】3.13-Matplotlib表格樣式創建【python】

【課程3.13】 表格樣式創建 表格視覺樣式:Dataframe.style → 返回pandas.Styler對象的屬性,具有格式化和顯示Dataframe的有用方法 樣式創建: ① Styler.applymap:elemen

原创 Python數據分析實戰【第三章】3.3-Matplotlib 圖表的樣式參數【python】

【課程3.3】 圖表的樣式參數 linestyle、style、color、marker 1.linestyle參數 plt.plot([i**2 for i in range(100)], linestyle

原创 Python數據分析實戰【第三章】3.7-Matplotlib面積圖、填圖、餅圖【python】

【課程3.8】 面積圖、填圖、餅圖 plt.plot.area() plt.fill(), plt.fill_between() plt.pie() 1.面積圖 fig,axes = plt.subplots(2,1,figs

原创 Python數據分析實戰【第三章】3.7-Matplotlib柱狀圖、堆疊圖【python】

1.柱狀圖與堆疊圖 fig,axes = plt.subplots(4,1,figsize = (10,10)) s = pd.Series(np.random.randint(0,10,16),index = list('abc

原创 Python數據分析實戰【第三章】3.9-Matplotlib直方圖【python】

1.直方圖+密度圖 s = pd.Series(np.random.randn(1000)) s.hist(bins = 20, histtype = 'bar', align = 'mid',

原创 Python數據分析實戰【第三章】3.2-Matplotlib圖表的基本元素【python】

【課程3.2】 圖表的基本元素 圖表內基本參數設置 1.圖名,圖例,軸標籤,軸邊界,軸刻度,軸刻度標籤等 df = pd.DataFrame(np.random.rand(10,2),columns=['A','B']) fig

原创 Python數據分析實戰【第三章】3.6-Matplotlib基本圖表繪製【python】

【課程3.6】 基本圖表繪製 plt.plot() 圖表類別:線形圖、柱狀圖、密度圖,以橫縱座標兩個維度爲主 同時可延展出多種其他圖表樣式 plt.plot(kind='line', ax=None, figsize=None,