pandas module 1 - cookbook
2016-07-15 22:13
344 查看
1. Idioms(习语)
(1)if-then on one column(2)if-then with assignment to 2 columns
(3)to do the -else
(4)use the mask
(5)if-then-else using numpy's where()
(6)Split a frame with a boolean criterion
(7) Select with multi-column criteria
(8)select rows with data closest to certain value using argsort
(9)Dynamically reduce a list of criteria using a binary operators
2. Selection
1. DataFrame(1) Using both row labels and value conditionals
(2)Use loc or iloc slicing
(3)using (~) to make a mask
2. Pannels(面板) -- adding a new dimension
3. creating a new columns (applymap)
4. keep other columns when using min() with groupby
3. Multi-Indexing
1. creating a multi-index from a labeled frame2. Performing arthmetic with a multi-index that needs broadcasting
3. slicing a multi-index with xs method1
4. sort with a multi-index
4. Missing Data
Fill forward a reversed timeseries
5. Grouping
1. Basic grouping with apply2. using get_group
3. In a group apply to different items
4. Expanding apply
5. Replacing some values
6. sort groups by aggregated(聚合) data
7. create multiple aggregated columns
8. create a value counts column and reassign back to the DataFrame
9. shift groups in a column
10. select row with max value from each group
11. grouping like python's itertools.groupby
12. create a list of dataframes, split using a delineation based on logic included in rows
13. partial sums(部分和) and subtotals(小计)
14. frequency table like plyr in R
15. using apply to turning embeded lists into a multi-index frame
16. Rolling apply with a DataFrame returning a Series
17. rolling apply with a DataFrame returning a Scalar(Volume Weighted Average Price)
6. Timeseries
1. calculate the first day of the month for each entry in a DatetimeIndex
7. Merge
1. append two dataframes with overlapping index2. self join of a dataframe
8. Plotting
9. Data In/Out
1. CSV(1) sample
(2) skip row between beader and data
2. 二进制文件
10. Timedeltas
1. using time deltas2. datetime can be set to NaT
4000
相关文章推荐
- pandas module 1 - 0.简介
- 如何用Python Pandas以及正则表达式提取地址中的省份
- Pandas对数据框首列为被预测变量,其他列为自变量求WOE矩阵及IV值
- ImportError: Missing required dependencies ['numpy']
- Pandas简易入门(一)
- Pandas简易入门(四)
- 设置deepin深之度的镜像源为清华大学镜像或阿里云
- margin和padding的区别和用法
- 机器学习与Tensorflow(7)——tf.train.Saver()、inception-v3的应用
- hdu 5285(染色法判断二分图)
- Mac搭建nginx+rtmp服务器
- 网络基本功(二):细说交换机
- 关于TSVM的一些学习资料
- SQL Server 2014 SP2
- Android仿微信SlideView聊天列表滑动删除效果