pandas: powerful Python data analysis toolkit - 0.7.1tweaks regarding label-based slicing Label-based slicing using ix now requires that the index be sorted (monotonic) unless both the start and endpoint are contained in the index: In [909]: s = Series(randn(6) 018111 e 0.790509 But this is not: In [12]: s.ix[’b’:’h’] KeyError ’b’ If the index had been sorted, the “range selection” would have been possible: In [912]: s2 = s.sort_index() In [913]: s2 Out[913]: corresponding to the labels in the index will be pulled out. Otherwise, an index will be constructed from the sorted keys of the dict, if possible. In [232]: d = {’a’ : 0., ’b’ : 1., ’c’ : 2.} In [233]: Series(d)0 码力 | 281 页 | 1.45 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.7.2tweaks regarding label-based slicing Label-based slicing using ix now requires that the index be sorted (monotonic) unless both the start and endpoint are contained in the index: 6 Chapter 1. What’s New 018111 e 0.790509 But this is not: In [12]: s.ix[’b’:’h’] KeyError ’b’ If the index had been sorted, the “range selection” would have been possible: In [913]: s2 = s.sort_index() In [914]: s2 Out[914]: corresponding to the labels in the index will be pulled out. Otherwise, an index will be constructed from the sorted keys of the dict, if possible. In [232]: d = {’a’ : 0., ’b’ : 1., ’c’ : 2.} In [233]: Series(d)0 码力 | 283 页 | 1.45 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.17.0np.array (GH10508) • unordered category: values and categories are sorted by appearance order. • ordered category: values are sorted by appearance order, categories keep existing order. In [84]: cat unique() if s is of dtype category) now appear in the order in which they are originally found, not in sorted order (GH9331). This is now consistent with the behavior for other dtypes in pandas. • Fixed bug API changes • Indexing in MultiIndex beyond lex-sort depth is now supported, though a lexically sorted index will have a better performance. (GH2646) In [1]: df = pd.DataFrame({'jim':[0, 0, 1, 1],0 码力 | 1787 页 | 10.76 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.7.3tweaks regarding label-based slicing Label-based slicing using ix now requires that the index be sorted (monotonic) unless both the start and endpoint are contained in the index: In [940]: s = Series(randn(6) 060935 e 1.546728 But this is not: In [12]: s.ix[’b’:’h’] KeyError ’b’ If the index had been sorted, the “range selection” would have been possible: 10 Chapter 1. What’s New pandas: powerful Python corresponding to the labels in the index will be pulled out. Otherwise, an index will be constructed from the sorted keys of the dict, if possible. In [232]: d = {’a’ : 0., ’b’ : 1., ’c’ : 2.} In [233]: Series(d)0 码力 | 297 页 | 1.92 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.15API changes • Indexing in MultiIndex beyond lex-sort depth is now supported, though a lexically sorted index will have a better performance. (GH2646) In [1]: df = pd.DataFrame({’jim’:[0, 0, 1, 1], (GH8584). • Bug in MultiIndex where __contains__ returns wrong result if index is not lexically sorted or unique (GH7724) • BUG CSV: fix problem with trailing whitespace in skipped rows, (GH8679), (GH8661) expanding_corr(), rolling_cov(), rolling_cor(), ewmcov(), and ewmcorr() returning results with columns sorted by name and producing an error for non-unique columns; now handles non-unique columns and returns0 码力 | 1579 页 | 9.15 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.15.1expanding_corr(), rolling_cov(), rolling_cor(), ewmcov(), and ewmcorr() returning results with columns sorted by name and producing an error for non-unique columns; now handles non-unique columns and returns passing a where (GH8014) • Bug in DataFrameGroupby.transform when transforming with a passed non-sorted key (GH8046, GH8430) • Bug in repeated timeseries line and area plot may result in ValueError or string like objects returns a different Index (GH7088). Previously the index was unintentionally sorted. • Arithmetic operations with only bool dtypes now give a warning indicating that they are evaluated0 码力 | 1557 页 | 9.10 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.14.0string like objects returns a different Index (GH7088). Previously the index was unintentionally sorted. • Arithmetic operations with only bool dtypes now give a warning indicating that they are evaluated implicit column and a specified usecols value • DataFrames with numerical or datetime indices are now sorted prior to plotting (GH2609) 1.6. v0.10.1 (January 22, 2013) 85 pandas: powerful Python data analysis tweaks regarding label-based slicing Label-based slicing using ix now requires that the index be sorted (monotonic) unless both the start and endpoint are contained in the index: In [8]: s = Series(randn(6)0 码力 | 1349 页 | 7.67 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.19.0exception (GH13235) • Bug in .tz_convert on a tz-aware DateTimeIndex that relied on index being sorted for correct results (GH13306) • Bug in .tz_localize with dateutil.tz.tzlocal may return incorrect (GH13792) • Bug in .iloc when indexing with a non lex-sorted MultiIndex (GH13797) • Bug in .loc when indexing with date strings in a reverse sorted DatetimeIndex (GH14316) • Bug in Series comparison operators np.array (GH10508) • unordered category: values and categories are sorted by appearance order. • ordered category: values are sorted by appearance order, categories keep existing order. In [84]: cat0 码力 | 1937 页 | 12.03 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.19.1exception (GH13235) • Bug in .tz_convert on a tz-aware DateTimeIndex that relied on index being sorted for correct results (GH13306) • Bug in .tz_localize with dateutil.tz.tzlocal may return incorrect (GH13792) • Bug in .iloc when indexing with a non lex-sorted MultiIndex (GH13797) • Bug in .loc when indexing with date strings in a reverse sorted DatetimeIndex (GH14316) 1.2. v0.19.0 (October 2, 2016) np.array (GH10508) • unordered category: values and categories are sorted by appearance order. • ordered category: values are sorted by appearance order, categories keep existing order. In [84]: cat0 码力 | 1943 页 | 12.06 MB | 1 年前3
pandas: powerful Python data analysis toolkit - 0.13.1implicit column and a specified usecols value • DataFrames with numerical or datetime indices are now sorted prior to plotting (GH2609) • Fixed DataFrame.from_records error when passed columns, index, but tweaks regarding label-based slicing Label-based slicing using ix now requires that the index be sorted (monotonic) unless both the start and endpoint are contained in the index: In [8]: s = Series(randn(6) data analysis toolkit, Release 0.13.1 In [12]: s.ix[’b’:’h’] KeyError ’b’ If the index had been sorted, the “range selection” would have been possible: In [11]: s2 = s.sort_index() In [12]: s2 Out[12]:0 码力 | 1219 页 | 4.81 MB | 1 年前3
共 32 条
- 1
- 2
- 3
- 4













