Upgrading pandas 0.20 to 0.21
Breaking0.20.3 → 0.21.1Breaking1Deprecated1New3Changed2Fixed2
BreakingUpgrade verdict
1 breaking change.
In plain terms
- Summing or multiplying an all-missing column now gives the same result whether or not the bottleneck package is installed.
- Selecting several labels at once when some do not exist is now deprecated and will become an error later.
Must act 2 items need code or config changes
What you must change
Breaking1
Makes sum and prod on all-NaN Series/DataFrames consistent and independent of whether bottleneck is installed.
sumprodDeprecations to plan for
Deprecated1
Deprecates indexing with a list of labels where one or more labels is missing; a future version will raise KeyError.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- removed:
class OrderedDefaultdict(OrderedDict) - removed:
constructor OrderedDefaultdict(*args, **kwargs) - added:
function get_range_parameters(data) - added:
function to_str(s) - added:
variable PYPY
- removed:
variable _np_version_under1p8 - removed:
variable _np_version_under1p9 - added:
variable _np_version_under1p15
- added:
variable ALLANY_DEFAULTS - added:
variable validate_all - added:
variable validate_any
- added:
class AccessorProperty(object) - added:
class DirNamesMixin(object) - added:
class PandasDelegate(object) - added:
constructor AccessorProperty(accessor_cls, construct_accessor=…)
- removed:
function safe_sort(values, labels=…, na_sentinel=…, assume_unique=…)
- added:
class TimeGrouper(object)
- removed:
class AccessorProperty(object) - removed:
class PandasDelegate(PandasObject) - removed:
constructor AccessorProperty(accessor_cls, construct_accessor) - changed:
class PandasObject(StringMixin) → class PandasObject(StringMixin, DirNamesMixin) - added:
method IndexOpsMixin.tolist()
- removed:
field Categorical.categories - removed:
field Categorical.dtype - removed:
field Categorical.ordered - removed:
function maybe_to_categorical(array) - removed:
method Categorical.isnull() - removed:
method Categorical.notnull() - removed:
method Categorical.order(inplace=…, ascending=…, na_position=…) - removed:
method Categorical.sort(inplace=…, ascending=…, na_position=…, **kwargs) - changed:
class CategoricalAccessor(PandasDelegate, NoNewAttributesMixin) → class CategoricalAccessor(PandasDelegate, PandasObject, NoNewAttributesMixin) - changed:
constructor Categorical(values, categories=…, ordered=…, fastpath=…) → constructor Categorical(values, categories=…, ordered=…, dtype=…, fastpath=…) - changed:
constructor CategoricalAccessor(values, index) → constructor CategoricalAccessor(values, index, name) - added:
field Categorical.isnull - added:
field Categorical.notnull - added:
method Categorical.isna() - added:
method Categorical.notna() - added:
method Categorical.tolist() - added:
property Categorical.categories - added:
property Categorical.dtype - added:
property Categorical.ordered
- added:
function is_true_slices(l) - added:
function standardize_mapping(into)
- removed:
variable _NUMEXPR_INSTALLED
- added:
variable _NUMEXPR_INSTALLED
- changed:
function evaluate(op, op_str, a, b, raise_on_error=…, use_numexpr=…, **eval_kwargs) → function evaluate(op, op_str, a, b, use_numexpr=…, **eval_kwargs) - changed:
function where(cond, a, b, raise_on_error=…, use_numexpr=…) → function where(cond, a, b, use_numexpr=…)
- removed:
function mpl_style_cb(key) - removed:
function use_inf_as_null_cb(key) - removed:
variable pc_height_deprecation_warning - removed:
variable pc_line_width_deprecation_warning - removed:
variable pc_mpl_style_deprecation_warning - removed:
variable pc_mpl_style_doc - added:
function register_converter_cb(key) - added:
function use_inf_as_na_cb(key) - added:
variable parquet_engine_doc - added:
variable pc_html_border_deprecation_warning - added:
variable register_converter_doc - added:
variable use_inf_as_na_doc
- changed:
function infer_dtype_from_array(arr) → function infer_dtype_from_array(arr, pandas_dtype=…) - added:
function cast_scalar_to_array(shape, value, dtype=…) - added:
function infer_dtype_from(val, pandas_dtype=…) - added:
function maybe_infer_dtype_type(element)
- added:
function is_dtype_union_equal(source, target)
- added:
constructor CategoricalDtype(categories=…, ordered=…) - added:
property CategoricalDtype.categories - added:
property CategoricalDtype.ordered
- added:
variable ABCDateOffset
- removed:
function isnull(obj) - removed:
function notnull(obj) - added:
function isna(obj) - added:
function notna(obj) - added:
function remove_na_arraylike(arr) - added:
variable isnull - added:
variable notnull
- removed:
function boxplot(self, column=…, by=…, ax=…, fontsize=…, rot=…, grid=…, figsize=…, layout=…, return_type=…, **kwds) - changed:
method DataFrame.merge(right, how=…, on=…, left_on=…, right_on=…, left_index=…, right_index=…, sort=…, suffixes=…, copy=…, indicator=…) → method DataFrame.merge(right, how=…, on=…, left_on=…, right_on=…, left_index=…, right_index=…, sort=…, suffixes=…, copy=…, indicator=…, validate=…) - changed:
method DataFrame.reindex(index=…, columns=…, **kwargs) → method DataFrame.reindex(*args, **kwargs) - changed:
method DataFrame.rename(index=…, columns=…, **kwargs) → method DataFrame.rename(*args, **kwargs) - changed:
method DataFrame.to_dict(orient=…) → method DataFrame.to_dict(orient=…, into=…) - added:
field DataFrame.boxplot - added:
field DataFrame.hist - added:
field DataFrame.plot - added:
method DataFrame.isna() - added:
method DataFrame.isnull() - added:
method DataFrame.notna() - added:
method DataFrame.notnull() - added:
method DataFrame.pivot_table(values=…, index=…, columns=…, aggfunc=…, fill_value=…, margins=…, dropna=…, margins_name=…) - added:
method DataFrame.to_parquet(fname, engine=…, compression=…, **kwargs)
- changed:
method NDFrame.clip(lower=…, upper=…, axis=…, *args, **kwargs) → method NDFrame.clip(lower=…, upper=…, axis=…, inplace=…, *args, **kwargs) - changed:
method NDFrame.clip_lower(threshold, axis=…) → method NDFrame.clip_lower(threshold, axis=…, inplace=…) - changed:
method NDFrame.clip_upper(threshold, axis=…) → method NDFrame.clip_upper(threshold, axis=…, inplace=…) - changed:
method NDFrame.drop(labels, axis=…, level=…, inplace=…, errors=…) → method NDFrame.drop(labels=…, axis=…, index=…, columns=…, level=…, inplace=…, errors=…) - changed:
method NDFrame.mask(cond, other=…, inplace=…, axis=…, level=…, try_cast=…, raise_on_error=…) → method NDFrame.mask(cond, other=…, inplace=…, axis=…, level=…, errors=…, try_cast=…, raise_on_error=…) - changed:
method NDFrame.set_axis(axis, labels) → method NDFrame.set_axis(labels, axis=…, inplace=…) - changed:
method NDFrame.sort_values(by, axis=…, ascending=…, inplace=…, kind=…, na_position=…) → method NDFrame.sort_values(by=…, axis=…, ascending=…, inplace=…, kind=…, na_position=…) - changed:
method NDFrame.to_json(path_or_buf=…, orient=…, date_format=…, double_precision=…, force_ascii=…, date_unit=…, default_handler=…, lines=…) → method NDFrame.to_json(path_or_buf=…, orient=…, date_format=…, double_precision=…, force_ascii=…, date_unit=…, default_handler=…, lines=…, compression=…) - changed:
method NDFrame.to_pickle(path, compression=…) → method NDFrame.to_pickle(path, compression=…, protocol=…) - changed:
method NDFrame.where(cond, other=…, inplace=…, axis=…, level=…, try_cast=…, raise_on_error=…) → method NDFrame.where(cond, other=…, inplace=…, axis=…, level=…, errors=…, try_cast=…, raise_on_error=…) - added:
method NDFrame.infer_objects() - added:
method NDFrame.isna() - added:
method NDFrame.notna()
- changed:
constructor BaseGrouper(axis, groupings, sort=…, group_keys=…, mutated=…) → constructor BaseGrouper(axis, groupings, sort=…, group_keys=…, mutated=…, indexer=…) - changed:
constructor BinGrouper(bins, binlabels, filter_empty=…, mutated=…) → constructor BinGrouper(bins, binlabels, filter_empty=…, mutated=…, indexer=…) - added:
field DataFrameGroupBy.boxplot - added:
method BaseGrouper.label_info() - added:
method GroupBy.pipe(func, *args, **kwargs) - added:
method SeriesGroupBy.apply(func, *args, **kwargs)
- changed:
class Properties(PandasDelegate, NoNewAttributesMixin) → class Properties(PandasDelegate, PandasObject, NoNewAttributesMixin) - added:
property DatetimeProperties.freq - added:
property TimedeltaProperties.freq
- removed:
function _get_distinct_indexes(indexes) - added:
export _ensure_index_from_sequences - added:
function _get_objs_combined_axis(objs, intersect=…, axis=…)
- removed:
field Index.sym_diff - removed:
method Index.isnull() - removed:
method Index.notnull() - removed:
method Index.tolist() - changed:
class Index(IndexOpsMixin, StringAccessorMixin, PandasObject) → class Index(IndexOpsMixin, PandasObject) - added:
field Index.isnull - added:
field Index.notnull - added:
field Index.str - added:
method Index.isna() - added:
method Index.notna() - added:
method Index.to_frame(index=…)
- changed:
class CategoricalIndex(Index, base.PandasDelegate) → class CategoricalIndex(Index, accessor.PandasDelegate) - added:
method CategoricalIndex.tolist() - added:
property CategoricalIndex.is_monotonic_decreasing - added:
property CategoricalIndex.is_monotonic_increasing
- changed:
function bdate_range(start=…, end=…, periods=…, freq=…, tz=…, normalize=…, name=…, closed=…, **kwargs) → function bdate_range(start=…, end=…, periods=…, freq=…, tz=…, normalize=…, name=…, weekmask=…, holidays=…, closed=…, **kwargs)
- changed:
function interval_range(start=…, end=…, freq=…, periods=…, name=…, closed=…, **kwargs) → function interval_range(start=…, end=…, periods=…, freq=…, name=…, closed=…)
- removed:
method MultiIndex.is_lexsorted_for_tuple(tup) - removed:
property MultiIndex.is_monotonic_decreasing - changed:
method MultiIndex.get_locs(tup) → method MultiIndex.get_locs(seq) - added:
method MultiIndex.is_monotonic_decreasing()
- added:
method RangeIndex.max() - added:
method RangeIndex.min()
- removed:
property TimedeltaIndex.days - removed:
property TimedeltaIndex.microseconds - removed:
property TimedeltaIndex.nanoseconds - removed:
property TimedeltaIndex.seconds - added:
field TimedeltaIndex.days - added:
field TimedeltaIndex.microseconds - added:
field TimedeltaIndex.nanoseconds - added:
field TimedeltaIndex.seconds
- removed:
method Block.get(item) - removed:
method Block.to_object_block(mgr) - removed:
method BlockManager.isnull(**kwargs) - removed:
method DatetimeTZBlock.to_object_block(mgr) - removed:
method JoinUnit.is_null() - removed:
method NonConsolidatableMixIn.get(item) - changed:
method Block.eval(func, other, raise_on_error=…, try_cast=…, mgr=…) → method Block.eval(func, other, errors=…, try_cast=…, mgr=…) - changed:
method Block.where(other, cond, align=…, raise_on_error=…, try_cast=…, axis=…, transpose=…, mgr=…) → method Block.where(other, cond, align=…, errors=…, try_cast=…, axis=…, transpose=…, mgr=…) - added:
function is_uniform_join_units(join_units) - added:
method Block.coerce_to_target_dtype(other) - added:
method Block.concat_same_type(to_concat, placement=…) - added:
method Block.formatting_values() - added:
method Block.split_and_operate(mask, f, inplace) - added:
method BlockManager.isna(**kwargs) - added:
method BlockManager.to_dict(copy=…) - added:
method BlockManager.unstack(unstacker_func) - added:
method CategoricalBlock.concat_same_type(to_concat, placement=…) - added:
method DatetimeTZBlock.concat_same_type(to_concat, placement=…) - added:
method JoinUnit.is_na() - added:
method SingleBlockManager.concat(to_concat, new_axis) - added:
method SingleBlockManager.formatting_values()
- changed:
constructor bottleneck_switch(zero_value=…, **kwargs) → constructor bottleneck_switch(**kwargs) - added:
variable ver
- changed:
method Panel.reindex(items=…, major_axis=…, minor_axis=…, **kwargs) → method Panel.reindex(*args, **kwargs)
- added:
function panel4d_reindex(self, labs=…, labels=…, items=…, major_axis=…, minor_axis=…, axis=…, **kwargs)
- removed:
field PeriodIndexResampler.agg - removed:
method PeriodIndexResampler.aggregate(arg, *args, **kwargs) - changed:
constructor TimeGrouper(freq=…, closed=…, label=…, how=…, nperiods=…, axis=…, fill_method=…, limit=…, loffset=…, kind=…, convention=…, base=…, **kwargs) → constructor TimeGrouper(freq=…, closed=…, label=…, how=…, axis=…, fill_method=…, limit=…, loffset=…, kind=…, convention=…, base=…, **kwargs) - added:
method Resampler.nearest(limit=…) - added:
method Resampler.size()
- removed:
class MergeError(ValueError) - changed:
function merge(left, right, how=…, on=…, left_on=…, right_on=…, left_index=…, right_index=…, sort=…, suffixes=…, copy=…, indicator=…) → function merge(left, right, how=…, on=…, left_on=…, right_on=…, left_index=…, right_index=…, sort=…, suffixes=…, copy=…, indicator=…, validate=…)
- changed:
function crosstab(index, columns, values=…, rownames=…, colnames=…, aggfunc=…, margins=…, dropna=…, normalize=…) → function crosstab(index, columns, values=…, rownames=…, colnames=…, aggfunc=…, margins=…, margins_name=…, dropna=…, normalize=…)
- removed:
method Series.take(indices, axis=…, convert=…, is_copy=…, **kwargs) - removed:
method Series.tolist() - changed:
class Series(base.IndexOpsMixin, strings.StringAccessorMixin, generic.NDFrame) → class Series(base.IndexOpsMixin, generic.NDFrame) - changed:
method Series.to_dict() → method Series.to_dict(into=…) - added:
field Series.hist - added:
field Series.plot - added:
field Series.str - added:
method Series.isna() - added:
method Series.isnull() - added:
method Series.notna() - added:
method Series.notnull()
- added:
function safe_sort(values, labels=…, na_sentinel=…, assume_unique=…)
- added:
method SparseArray.all(axis=…, *args, **kwargs) - added:
method SparseArray.any(axis=…, *args, **kwargs)
- removed:
method SparseDataFrame.isnotnull() - removed:
method SparseDataFrame.isnull() - added:
field SparseDataFrame.isnull - added:
field SparseDataFrame.notnull - added:
method SparseDataFrame.isna() - added:
method SparseDataFrame.notna()
- removed:
method SparseSeries.isnotnull() - removed:
method SparseSeries.isnull() - added:
field SparseSeries.isnull - added:
field SparseSeries.notnull - added:
method SparseSeries.isna() - added:
method SparseSeries.notna()
- removed:
class StringAccessorMixin(object) - removed:
field StringAccessorMixin.str
- removed:
function parse_time_string(arg, freq=…, dayfirst=…, yearfirst=…) - removed:
variable DateParseError
- added:
class MergeError(ValueError)
- removed:
variable need_text_wrapping
- changed:
function read_excel(io, sheetname=…, header=…, skiprows=…, skip_footer=…, index_col=…, names=…, parse_cols=…, parse_dates=…, date_parser=…, na_values=…, thousands=…, convert_float=…, has_index_names=…, converters=…, dtype=…, true_values=…, false_values=…, engine=…, squeeze=…, **kwds) → function read_excel(io, sheet_name=…, header=…, skiprows=…, skip_footer=…, index_col=…, names=…, usecols=…, parse_dates=…, date_parser=…, na_values=…, thousands=…, convert_float=…, converters=…, dtype=…, true_values=…, false_values=…, engine=…, squeeze=…, **kwds) - changed:
method ExcelFile.parse(sheetname=…, header=…, skiprows=…, skip_footer=…, names=…, index_col=…, parse_cols=…, parse_dates=…, date_parser=…, na_values=…, thousands=…, convert_float=…, has_index_names=…, converters=…, true_values=…, false_values=…, squeeze=…, **kwds) → method ExcelFile.parse(sheet_name=…, header=…, skiprows=…, skip_footer=…, names=…, index_col=…, usecols=…, parse_dates=…, date_parser=…, na_values=…, thousands=…, convert_float=…, converters=…, true_values=…, false_values=…, squeeze=…, **kwds)
- changed:
function read_feather(path) → function read_feather(path, nthreads=…)
- added:
method Styler.where(cond, value, other=…, subset=…, **kwargs)
- changed:
function read_json(path_or_buf=…, orient=…, typ=…, dtype=…, convert_axes=…, convert_dates=…, keep_default_dates=…, numpy=…, precise_float=…, date_unit=…, encoding=…, lines=…) → function read_json(path_or_buf=…, orient=…, typ=…, dtype=…, convert_axes=…, convert_dates=…, keep_default_dates=…, numpy=…, precise_float=…, date_unit=…, encoding=…, lines=…, chunksize=…, compression=…) - changed:
function to_json(path_or_buf, obj, orient=…, date_format=…, double_precision=…, force_ascii=…, date_unit=…, default_handler=…, lines=…) → function to_json(path_or_buf, obj, orient=…, date_format=…, double_precision=…, force_ascii=…, date_unit=…, default_handler=…, lines=…, compression=…) - added:
class JsonReader(BaseIterator) - added:
constructor JsonReader(filepath_or_buffer, orient, typ, dtype, convert_axes, convert_dates, keep_default_dates, numpy, precise_float, date_unit, encoding, lines, chunksize, compression) - added:
method JsonReader.close() - added:
method JsonReader.read()
- added:
class BaseImpl(object) - added:
class FastParquetImpl(BaseImpl) - added:
class PyArrowImpl(BaseImpl) - added:
constructor FastParquetImpl() - added:
constructor PyArrowImpl() - added:
field BaseImpl.api - added:
function get_engine(engine) - added:
function read_parquet(path, engine=…, columns=…, **kwargs) - added:
function to_parquet(df, path, engine=…, compression=…, **kwargs) - added:
method BaseImpl.read(path, columns=…, **kwargs) - added:
method BaseImpl.write(df, path, compression, **kwargs) - added:
method FastParquetImpl.read(path, columns=…, **kwargs) - added:
method FastParquetImpl.write(df, path, compression=…, **kwargs) - added:
method PyArrowImpl.read(path, columns=…, **kwargs) - added:
method PyArrowImpl.write(df, path, compression=…, coerce_timestamps=…, **kwargs) - added:
static method BaseImpl.validate_dataframe(df)
- changed:
function to_pickle(obj, path, compression=…) → function to_pickle(obj, path, compression=…, protocol=…)
- added:
method HDFStore.info()
- added:
variable sas_date_formats - added:
variable sas_datetime_formats
- changed:
constructor StataReader(path_or_buf, convert_dates=…, convert_categoricals=…, index=…, convert_missing=…, preserve_dtypes=…, columns=…, order_categoricals=…, encoding=…, chunksize=…) → constructor StataReader(path_or_buf, convert_dates=…, convert_categoricals=…, index_col=…, convert_missing=…, preserve_dtypes=…, columns=…, order_categoricals=…, encoding=…, chunksize=…) - changed:
function read_stata(filepath_or_buffer, convert_dates=…, convert_categoricals=…, encoding=…, index=…, convert_missing=…, preserve_dtypes=…, columns=…, order_categoricals=…, chunksize=…, iterator=…) → function read_stata(filepath_or_buffer, convert_dates=…, convert_categoricals=…, encoding=…, index_col=…, convert_missing=…, preserve_dtypes=…, columns=…, order_categoricals=…, chunksize=…, iterator=…) - changed:
method StataReader.read(nrows=…, convert_dates=…, convert_categoricals=…, index=…, convert_missing=…, preserve_dtypes=…, columns=…, order_categoricals=…) → method StataReader.read(nrows=…, convert_dates=…, convert_categoricals=…, index_col=…, convert_missing=…, preserve_dtypes=…, columns=…, order_categoricals=…)
- added:
export deregister_matplotlib_converters - added:
export register_matplotlib_converters
- added:
function register()
- removed:
function get_freq_code(freqstr) - removed:
function get_offset_name(offset) - removed:
variable opattern
- removed:
constructor Easter(n=…, **kwds) - removed:
constructor QuarterEnd(n=…, normalize=…, **kwds) - removed:
method BusinessDay.isAnchored() - removed:
method CustomBusinessDay.get_calendar(weekmask, holidays, calendar) - removed:
method QuarterBegin.isAnchored() - removed:
method QuarterEnd.isAnchored() - removed:
property BusinessDay.freqstr - changed:
constructor BusinessDay(n=…, normalize=…, **kwds) → constructor BusinessDay(n=…, normalize=…, offset=…) - changed:
constructor BusinessHour(n=…, normalize=…, **kwds) → constructor BusinessHour(n=…, normalize=…, start=…, end=…, offset=…) - changed:
constructor CustomBusinessDay(n=…, normalize=…, weekmask=…, holidays=…, calendar=…, **kwds) → constructor CustomBusinessDay(n=…, normalize=…, weekmask=…, holidays=…, calendar=…, offset=…) - changed:
constructor CustomBusinessHour(n=…, normalize=…, weekmask=…, holidays=…, calendar=…, **kwds) → constructor CustomBusinessHour(n=…, normalize=…, weekmask=…, holidays=…, calendar=…, start=…, end=…, offset=…) - changed:
constructor FY5253(n=…, normalize=…, **kwds) → constructor FY5253(n=…, normalize=…, weekday=…, startingMonth=…, variation=…) - changed:
constructor FY5253Quarter(n=…, normalize=…, **kwds) → constructor FY5253Quarter(n=…, normalize=…, weekday=…, startingMonth=…, qtr_with_extra_week=…, variation=…) - changed:
constructor LastWeekOfMonth(n=…, normalize=…, **kwds) → constructor LastWeekOfMonth(n=…, normalize=…, weekday=…) - changed:
constructor Week(n=…, normalize=…, **kwds) → constructor Week(n=…, normalize=…, weekday=…) - changed:
constructor WeekOfMonth(n=…, normalize=…, **kwds) → constructor WeekOfMonth(n=…, normalize=…, week=…, weekday=…) - added:
method BusinessHour.next_bday() - added:
method CustomBusinessHour.next_bday()