自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 190422-Grouping data

1. Categoricals and groupbyboolean filter and countgroupby and countgroupby and sumgroupby and sum multiple columnsgroupby and mean: multi-level indexgroupby and sum by Series把数据...

2019-04-23 00:01:16 241

原创 190417-Rearranging and reshaping data

1. Pivoting DataFrames如果不指定value那么多个column会被计算2.Stacking & unstacking DataFramesunstacking dataframesdf.unstack(level="")level=1是指第二级stacking dataframesswapping levels of in...

2019-04-18 00:59:32 137

原创 190414-Manipulating DataFrames with pandas-Extracting and transforming data

1.Indexing DataFrameIndexing using square bracketsUsing column attribute and row labelsUsing the .loc/.ilocaccessorselecting only some columns2. Slicing DataFrame数据中某一列的数据类型是Series, S...

2019-04-14 21:49:00 187

原创 20190407-Time series in Pandas

1. 去除字符串中的空格:strip()2. 调用dataframe中的所有column:df.columns3. 字符串是否包含某个关键字:str.contains()4. resample时间序列数据by day并且求和,此处利用pandas中True为1、False为0:resample('D').sum()5. reindex()6. np.abs(): 绝对值...

2019-04-07 21:31:59 125

原创 Statistic-General

1. quantiledf.quantile(0.5)=df.median()IQR: df.quantile([0.25,0.75])2. mean:axis='columns' : 计算所有column的均值3. 非数值型数据4.利用分类型数据生成按不同分类的新的dataframe,df.loc注意以下两种方式本质上都用了双重df...

2019-03-31 21:47:24 140

原创 scatter-sepcification

df.plot(kind='scatter',s=sizes)sizes是一组存储好散点图面积的数组。

2019-03-31 20:41:45 154

原创 Histgram-specification

df.plot(kind='hist')df.plt.hist()iris.hist()1. 基础参数一览:bins/range/normed/cumulative2. subplots分区3. alpha=0.3, 数据条透明度为30%

2019-03-31 20:34:04 269

原创 Plotting with pandas-General

df.plot( color='red',x=' ',y=' ',kind='scatter'/'box'/'hist')plt.title(' ')plt.xlabel(' ')plt.ylabel(' ')plt.show()df.plot(subplot=True)df[column_list].plot()1. subplot2. df[co...

2019-03-31 20:15:08 150

原创 pd.read_csv

1. pd.read_csv()df = pd.read_csv(data_file, header=0, names=['year','population']df= pd.read_csv(file_messy, delimiter=' ', header=3, comment='#')1)header: header=None, 那么表示原始文件数据没有列索引,除非你给出nam...

2019-03-30 18:59:52 1330

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除