没有合适的资源?快使用搜索试试~ 我知道了~
首页pandas reference 0.23.0
资源详情
资源评论
资源推荐

pandas: powerful Python data analysis
toolkit
Release 0.23.0
Wes McKinney & PyData Development Team
May 15, 2018


CONTENTS
1 What’s New 3
1.1 v0.23.0 (May 15, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1 New features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.1.1 JSON read/write round-trippable with orient='table' . . . . . . . . . . . . . 5
1.1.1.2 .assign() accepts dependent arguments . . . . . . . . . . . . . . . . . . . . . . 6
1.1.1.3 Merging on a combination of columns and index levels . . . . . . . . . . . . . . . 7
1.1.1.4 Sorting by a combination of columns and index levels . . . . . . . . . . . . . . . . 8
1.1.1.5 Extending Pandas with Custom Types (Experimental) . . . . . . . . . . . . . . . . 8
1.1.1.6 New observed keyword for excluding unobserved categories in groupby . . . . 9
1.1.1.7 Rolling/Expanding.apply() accepts raw=False to pass a Series to the function 11
1.1.1.8 DataFrame.interpolate has gained the limit_area kwarg . . . . . . . . 12
1.1.1.9 get_dummies now supports dtype argument . . . . . . . . . . . . . . . . . . . 13
1.1.1.10 Timedelta mod method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.1.1.11 .rank() handles inf values when NaN are present . . . . . . . . . . . . . . . . 14
1.1.1.12 Series.str.cat has gained the join kwarg . . . . . . . . . . . . . . . . . . 15
1.1.1.13 DataFrame.astype performs column-wise conversion to Categorical . . . 16
1.1.1.14 Other Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.1.2 Backwards incompatible API changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.1.2.1 Dependencies have increased minimum versions . . . . . . . . . . . . . . . . . . . 18
1.1.2.2 Instantiation from dicts preserves dict insertion order for python 3.6+ . . . . . . . . 19
1.1.2.3 Deprecate Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.1.2.4 pandas.core.common removals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.1.2.5 Changes to make output of DataFrame.apply consistent . . . . . . . . . . . . 21
1.1.2.6 Concatenation will no longer sort . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.1.2.7 Build Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.1.2.8 Index Division By Zero Fills Correctly . . . . . . . . . . . . . . . . . . . . . . . . 23
1.1.2.9 Extraction of matching patterns from strings . . . . . . . . . . . . . . . . . . . . . 24
1.1.2.10 Default value for the ordered parameter of CategoricalDtype . . . . . . . . 25
1.1.2.11 Better pretty-printing of DataFrames in a terminal . . . . . . . . . . . . . . . . . . 26
1.1.2.12 Datetimelike API Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.1.2.13 Other API Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.1.3 Deprecations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.1.4 Removal of prior version deprecations/changes . . . . . . . . . . . . . . . . . . . . . . . . 31
1.1.5 Performance Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.1.6 Documentation Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.1.7 Bug Fixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.1.7.1 Categorical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.1.7.2 Datetimelike . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.1.7.3 Timedelta . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1.1.7.4 Timezones . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
i

1.1.7.5 Offsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.1.7.6 Numeric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.1.7.7 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.1.7.8 Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.1.7.9 MultiIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1.1.7.10 I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.1.7.11 Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.1.7.12 Groupby/Resample/Rolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.1.7.13 Sparse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.1.7.14 Reshaping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.1.7.15 Other . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
1.2 v0.22.0 (December 29, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.2.1 Backwards incompatible API changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.2.1.1 Arithmetic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.2.1.2 Grouping by a Categorical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
1.2.1.3 Resample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
1.2.1.4 Rolling and Expanding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1.2.2 Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1.3 v0.21.1 (December 12, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
1.3.1 Restore Matplotlib datetime Converter Registration . . . . . . . . . . . . . . . . . . . . . . 47
1.3.2 New features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.2.1 Improvements to the Parquet IO functionality . . . . . . . . . . . . . . . . . . . . 48
1.3.2.2 Other Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.3 Deprecations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.4 Performance Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.5 Bug Fixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.5.1 Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.3.5.2 Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.3.5.3 I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.3.5.4 Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.3.5.5 Groupby/Resample/Rolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.3.5.6 Reshaping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.3.5.7 Numeric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.3.5.8 Categorical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.3.5.9 String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.4 v0.21.0 (October 27, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.4.1 New features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
1.4.1.1 Integration with Apache Parquet file format . . . . . . . . . . . . . . . . . . . . . 52
1.4.1.2 infer_objects type conversion . . . . . . . . . . . . . . . . . . . . . . . . . . 52
1.4.1.3 Improved warnings when attempting to create columns . . . . . . . . . . . . . . . 53
1.4.1.4 drop now also accepts index/columns keywords . . . . . . . . . . . . . . . . . . . 53
1.4.1.5 rename, reindex now also accept axis keyword . . . . . . . . . . . . . . . . . 54
1.4.1.6 CategoricalDtype for specifying categoricals . . . . . . . . . . . . . . . . . 55
1.4.1.7 GroupBy objects now have a pipe method . . . . . . . . . . . . . . . . . . . . . 56
1.4.1.8 Categorical.rename_categories accepts a dict-like . . . . . . . . . . . . 57
1.4.1.9 Other Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
1.4.2 Backwards incompatible API changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
1.4.2.1 Dependencies have increased minimum versions . . . . . . . . . . . . . . . . . . . 59
1.4.2.2 Sum/Prod of all-NaN or empty Series/DataFrames is now consistently NaN . . . . 59
1.4.2.3 Indexing with a list with missing labels is Deprecated . . . . . . . . . . . . . . . . 60
1.4.2.4 NA naming Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
1.4.2.5 Iteration of Series/Index will now return Python scalars . . . . . . . . . . . . . . . 61
1.4.2.6 Indexing with a Boolean Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
1.4.2.7 PeriodIndex resampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
ii

1.4.2.8 Improved error handling during item assignment in pd.eval . . . . . . . . . . . . . 64
1.4.2.9 Dtype Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
1.4.2.10 MultiIndex Constructor with a Single Level . . . . . . . . . . . . . . . . . . . . . 66
1.4.2.11 UTC Localization with Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
1.4.2.12 Consistency of Range Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
1.4.2.13 No Automatic Matplotlib Converters . . . . . . . . . . . . . . . . . . . . . . . . . 68
1.4.2.14 Other API Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
1.4.3 Deprecations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
1.4.3.1 Series.select and DataFrame.select . . . . . . . . . . . . . . . . . . . . . . . . . . 70
1.4.3.2 Series.argmax and Series.argmin . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
1.4.4 Removal of prior version deprecations/changes . . . . . . . . . . . . . . . . . . . . . . . . 70
1.4.5 Performance Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.4.6 Documentation Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.4.7 Bug Fixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.4.7.1 Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.4.7.2 Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
1.4.7.3 I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
1.4.7.4 Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
1.4.7.5 Groupby/Resample/Rolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
1.4.7.6 Sparse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.4.7.7 Reshaping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.4.7.8 Numeric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.4.7.9 Categorical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.4.7.10 PyPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.4.7.11 Other . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.5 v0.20.3 (July 7, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
1.5.1 Bug Fixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
1.5.1.1 Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
1.5.1.2 Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
1.5.1.3 I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
1.5.1.4 Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
1.5.1.5 Reshaping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
1.5.1.6 Categorical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
1.6 v0.20.2 (June 4, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
1.6.1 Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
1.6.2 Performance Improvements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
1.6.3 Bug Fixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
1.6.3.1 Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
1.6.3.2 Indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
1.6.3.3 I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
1.6.3.4 Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
1.6.3.5 Groupby/Resample/Rolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
1.6.3.6 Sparse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
1.6.3.7 Reshaping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
1.6.3.8 Numeric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
1.6.3.9 Categorical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
1.6.3.10 Other . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
1.7 v0.20.1 (May 5, 2017) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
1.7.1 New features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
1.7.1.1 agg API for DataFrame/Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
1.7.1.2 dtype keyword for data IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
1.7.1.3 .to_datetime() has gained an origin parameter . . . . . . . . . . . . . . . 85
1.7.1.4 Groupby Enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
1.7.1.5 Better support for compressed URLs in read_csv . . . . . . . . . . . . . . . . . 86
iii
剩余2602页未读,继续阅读













安全验证
文档复制为VIP权益,开通VIP直接复制

评论0