自定义博客皮肤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 groupby boolean filter and count groupby and count groupby and sum groupby and sum multiple columns groupby and mean: multi-level index groupby and sum by Series 把数据...

2019-04-23 00:01:16 390

原创 190417-Rearranging and reshaping data

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

2019-04-18 00:59:32 216

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

1.Indexing DataFrame Indexing using square brackets Using column attribute and row labels Using the .loc/.ilocaccessor selecting only some columns 2. Slicing DataFrame 数据中某一列的数据类型是Series, S...

2019-04-14 21:49:00 317

原创 20190407-Time series in Pandas

1. 去除字符串中的空格:strip() 2. 调用dataframe中的所有column:df.columns 3. 字符串是否包含某个关键字: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 227

原创 Statistic-General

1. quantile df.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 224

原创 scatter-sepcification

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

2019-03-31 20:41:45 225

原创 Histgram-specification

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

2019-03-31 20:34:04 348

原创 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. subplot 2. df[co...

2019-03-31 20:15:08 244

原创 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 1485

空空如也

空空如也

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

TA关注的人

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