Skip to content

REF: .values -> ._values #32947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 120 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
0be1713
CLN: avoid _ndarray_values
jbrockmendel Feb 28, 2020
e9e5db8
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Feb 28, 2020
953b04c
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Feb 29, 2020
f70e15d
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Feb 29, 2020
6197fbc
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Feb 29, 2020
6db54bd
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 1, 2020
4a1088e
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 2, 2020
3a4e2a2
more _values
jbrockmendel Mar 3, 2020
b0b024b
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 3, 2020
ed65b44
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 3, 2020
c92858a
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 3, 2020
ebaec34
_ndarray_values->asi8
jbrockmendel Mar 3, 2020
c2d5b1b
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 3, 2020
12ea11c
typo
jbrockmendel Mar 3, 2020
9f2b6ef
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 3, 2020
f7805b8
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 3, 2020
130c3e6
_ndarray_values->np.asarray
jbrockmendel Mar 3, 2020
5e8dcb6
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 3, 2020
63b05c6
unnecessary values_from_object calls
jbrockmendel Mar 3, 2020
c9989e2
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 4, 2020
92983f0
comments
jbrockmendel Mar 4, 2020
f32a1a0
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 4, 2020
d4a420b
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 5, 2020
35d3fdd
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 5, 2020
65f005f
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 6, 2020
201ca4e
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 6, 2020
cf9b479
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 6, 2020
d43348a
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 7, 2020
ee3a5b0
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 7, 2020
b0acf4c
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 7, 2020
ef05d7d
move comments to collect branch
jbrockmendel Mar 7, 2020
d5b5730
values->_values
jbrockmendel Mar 7, 2020
be0d40a
values->_values
jbrockmendel Mar 8, 2020
dce37dd
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 9, 2020
4fd7e62
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 11, 2020
8fa2dc0
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 11, 2020
8bcd1df
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 11, 2020
a13b6dc
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 11, 2020
61835a5
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 12, 2020
3971791
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 12, 2020
a49a3a6
checkpoint passing
jbrockmendel Mar 13, 2020
b9be012
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 13, 2020
11020b9
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 15, 2020
ed9ba9d
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 15, 2020
df25c00
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 17, 2020
f3a4d38
values-> _values
jbrockmendel Mar 17, 2020
6cb81b7
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 17, 2020
dc58813
.values->._values
jbrockmendel Mar 17, 2020
7541a49
[BUG] Loosen random_state input restriction (#32510)
mikekutzma Mar 17, 2020
10ce047
CLN: Split pandas/tests/base/test_ops.py (#32744)
SaturnFromTitan Mar 17, 2020
59b5e96
BUG: arithmetic with reindex pow (#32734)
jbrockmendel Mar 17, 2020
f2e8139
CLN: remove SingleBlockManager._values (#32716)
jbrockmendel Mar 17, 2020
413d883
DOC: 1.0.3 release date (#32783)
TomAugspurger Mar 17, 2020
00045aa
BUG: Respect check_dtype in assert_series_equal (#32757)
dsaxton Mar 17, 2020
a8107b1
CLN: remove unnecessary alias (#32786)
jbrockmendel Mar 17, 2020
211502f
copy license text from: tidyverse/haven (#32756)
jamin-aws-ospo Mar 18, 2020
a5535b9
BLD: Suppressing warnings when compiling pandas/_libs/writers (#32795)
ShaharNaveh Mar 18, 2020
72328e5
Avoid bare pytest.raises in dtypes/test_dtypes.py (#32672)
Vlek Mar 18, 2020
c93e078
PERF: Using Numpy C-API when calling `np.arange` (#32804)
ShaharNaveh Mar 18, 2020
e9eb25a
TYP: annotate to_numpy (#32809)
jbrockmendel Mar 18, 2020
166acee
fstring format added in pandas//tests/io/test_common.py:144: (#32813)
mglasder Mar 18, 2020
61e2e8f
BUG: Series.__getitem__ with downstream scalars (#32684)
jbrockmendel Mar 19, 2020
9fddf45
CLN: Using clearer imports (#32459)
ShaharNaveh Mar 19, 2020
fbe59da
REF: Implement core._algos (#32767)
jbrockmendel Mar 19, 2020
3949cef
CLN: Consolidate numba facilities (#32770)
mroeschke Mar 19, 2020
a4aa9d6
CLN: remove _ndarray_values (#32768)
jbrockmendel Mar 19, 2020
57ac04a
BLD: Suppressing errors while compling pandas/_libs/groupby (#32794)
ShaharNaveh Mar 19, 2020
ce6f0a9
TYP: PandasObject._cache (#32775)
topper-123 Mar 19, 2020
a85e525
Implement C Level Timedelta ISO Function; fix JSON usage (#30903)
WillAyd Mar 19, 2020
b3cba87
BUG: read_csv: fix wrong exception on permissions issue (#32737)
roberthdevries Mar 19, 2020
a7e0f14
Fixturize JSON tests (#31191)
WillAyd Mar 19, 2020
022ec63
PERF: fix SparseArray._simple_new object initialization (#32821)
jorisvandenbossche Mar 19, 2020
e6cba2d
Avoid bare pytest.raises in indexes/categorical/test_indexing.py (#32…
Vlek Mar 19, 2020
92cbb56
See also (#32820)
farhanreynaldo Mar 19, 2020
bc7c2b1
TYP: annotate (#32730)
jbrockmendel Mar 19, 2020
341a61a
TST: Parametrize in pandas/tests/internals/test_internals.py (#32687)
ShaharNaveh Mar 19, 2020
a69298e
TYP: update setup.cfg (#32829)
simonjayhawkins Mar 19, 2020
6dc3ac6
CLN: Update docstring decorator from Appender to doc (#32828)
raisadz Mar 19, 2020
1366dbf
BUG: Fix segfault on dir of a DataFrame with a unicode surrogate char…
roberthdevries Mar 19, 2020
9c26a2b
PERF: skip non-consolidatable blocks when checking consolidation (#32…
jorisvandenbossche Mar 19, 2020
ab14b53
CLN: remove DatetimeLikeArray._add_delta (#32799)
jbrockmendel Mar 19, 2020
b908eec
Error on C Warnings (#32163)
WillAyd Mar 19, 2020
e9088d1
CLN: simplify MultiIndex._shallow_copy (#32772)
topper-123 Mar 19, 2020
4e63f45
DOC: use new pydata-sphinx-theme name (#32840)
jorisvandenbossche Mar 19, 2020
20002ae
DOC: FutureWarning in Sphinx build when calling read_parquet (#32833)
ShaharNaveh Mar 20, 2020
ab26064
TST: Define sections in pandas/conftest.py (#32789)
SaturnFromTitan Mar 20, 2020
869e2cb
TST: bare pytest raises (#32817)
quangngd Mar 20, 2020
71d1257
Update 03_subset_data.rst (#32868)
rogererens Mar 20, 2020
d3013f7
STY: Correct whitespace placement (#32830)
ShaharNaveh Mar 20, 2020
72822bd
PERF: allow to skip validation/sanitization in DataFrame._from_arrays…
jorisvandenbossche Mar 20, 2020
afe17bf
BUG: is_scalar_indexer (#32850)
jbrockmendel Mar 20, 2020
4cdf41a
CLN: Replace Appender by doc in to_excel (#32787)
smartvinnetou Mar 20, 2020
6baeb9c
DOC: Remove latest whatsnew from header (#32870)
TomAugspurger Mar 20, 2020
ca7e787
TST: Avoid bare pytest.raises in multiple files (#32816)
Vlek Mar 21, 2020
56c3282
TST: organize tests in test_timeseries (#32889)
jbrockmendel Mar 21, 2020
34b869c
fix bare pytest raises in indexes/datetimes (#32884)
quangngd Mar 21, 2020
c9b58f3
PERF/REF: MultiIndex.copy (#32883)
topper-123 Mar 21, 2020
5739265
TST: misplaced Series.get test (#32876)
jbrockmendel Mar 21, 2020
0c097ea
REF: misplaced Timedelta tests (#32871)
jbrockmendel Mar 21, 2020
ba6cf0e
TST: add test for non UTC datetime split #14042 (#32866)
JDkuba Mar 21, 2020
cba3a5d
PERF: faster placement creating extension blocks from arrays (#32856)
jorisvandenbossche Mar 21, 2020
8cdfba1
CLN: unnecessary ABCClasses (#32891)
jbrockmendel Mar 21, 2020
ccaa5b6
CLN: pandas/_libs/tslibs/nattype.pyx (#32888)
ShaharNaveh Mar 21, 2020
e07d0ed
CLN: avoid .setitem in tests (#32852)
jbrockmendel Mar 21, 2020
342eb1e
REF: pass align_keys to apply (#32846)
jbrockmendel Mar 21, 2020
a5a09d3
BUG: ExtensionBlock.set not setting values inplace (#32831)
jbrockmendel Mar 21, 2020
9d9e5b6
CLN: .value -> ._values outside of core/ (#32781)
jbrockmendel Mar 21, 2020
78d98fc
CLN: Split up Boolean array tests (#32780)
dsaxton Mar 21, 2020
ce18cd6
CLN: Fix common spelling mistakes (#32895)
SaturnFromTitan Mar 21, 2020
8611dc2
TST: Replace tm.all_index_generator with indices fixture (#32886)
SaturnFromTitan Mar 22, 2020
dc94a97
REF: implement _with_freq, use _from_sequence less (#32849)
jbrockmendel Mar 22, 2020
78596ee
ERR: Raise on invalid na_action in Series.map (#32790)
dsaxton Mar 22, 2020
d375628
CLN: remove align kwarg from Block.where, Block.putmask (#32791)
jbrockmendel Mar 22, 2020
9014d05
TST: Avoid bare pytest.raises in test_series.py (#32879)
Vlek Mar 22, 2020
4b3920c
CLN: Period tests (#32875)
jbrockmendel Mar 22, 2020
8765637
TST: test that the .copy method on indexes copy the cache (#32898)
topper-123 Mar 22, 2020
b5898ad
REF: simplify should_extension_dispatch, remove dispatch_to_extension…
jbrockmendel Mar 22, 2020
619a25b
Merge branch 'master' of https://github.com/pandas-dev/pandas into no…
jbrockmendel Mar 23, 2020
1d6bf54
merge fixup
jbrockmendel Mar 23, 2020
73d29bd
values->_values
jbrockmendel Mar 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def value_counts(
result = result.sort_index()

# if we are dropna and we have NO values
if dropna and (result.values == 0).all():
if dropna and (result._values == 0).all():
result = result.iloc[0:0]

# normalizing is by len of all (regardless of dropna)
Expand All @@ -713,7 +713,7 @@ def value_counts(
# handle Categorical and sparse,
result = Series(values)._values.value_counts(dropna=dropna)
result.name = name
counts = result.values
counts = result._values

else:
keys, counts = _value_counts_arraylike(values, dropna)
Expand Down Expand Up @@ -823,7 +823,7 @@ def mode(values, dropna: bool = True) -> "Series":
# categorical is a fast-path
if is_categorical_dtype(values):
if isinstance(values, Series):
return Series(values.values.mode(dropna=dropna), name=values.name)
return Series(values._values.mode(dropna=dropna), name=values.name)
return values.mode(dropna=dropna)

if dropna and needs_i8_conversion(values.dtype):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def value_counts(self, dropna=False):
index = Index(
cls(result.index.view("i8"), dtype=self.dtype), name=result.index.name
)
return Series(result.values, index=index, name=result.name)
return Series(result._values, index=index, name=result.name)

def map(self, mapper):
# TODO(GH-23179): Add ExtensionArray.map
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class IntervalArray(IntervalMixin, ExtensionArray):
def __new__(cls, data, closed=None, dtype=None, copy=False, verify_integrity=True):

if isinstance(data, ABCSeries) and is_interval_dtype(data):
data = data.values
data = data._values

if isinstance(data, (cls, ABCIntervalIndex)):
left = data.left
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/masked.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ def value_counts(self, dropna: bool = True) -> "Series":
# TODO(extension)
# if we have allow Index to hold an ExtensionArray
# this is easier
index = value_counts.index.values.astype(object)
index = value_counts.index._values.astype(object)

# if we want nans, count the mask
if dropna:
counts = value_counts.values
counts = value_counts._values
else:
counts = np.empty(len(value_counts) + 1, dtype="int64")
counts[:-1] = value_counts
Expand Down
8 changes: 3 additions & 5 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def item(self):
):
# numpy returns ints instead of datetime64/timedelta64 objects,
# which we need to wrap in Timestamp/Timedelta/Period regardless.
return self.values.item()
return self._values.item()

if len(self) == 1:
return next(iter(self))
Expand Down Expand Up @@ -1132,10 +1132,8 @@ def _map_values(self, mapper, na_action=None):
# use the built in categorical series mapper which saves
# time by mapping the categories instead of all values
return self._values.map(mapper)
if is_extension_array_dtype(self.dtype):
values = self._values
else:
values = self.values

values = self._values

indexer = mapper.index.get_indexer(values)
new_values = algorithms.take_1d(mapper._values, indexer)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def asarray_tuplesafe(values, dtype=None):
if not (isinstance(values, (list, tuple)) or hasattr(values, "__array__")):
values = list(values)
elif isinstance(values, ABCIndexClass):
return values.values
return values._values

if isinstance(values, list) and dtype in [np.object_, object]:
return construct_1d_object_array_from_listlike(values)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/dtypes/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def astype_nansafe(arr, dtype, copy: bool = True, skipna: bool = False):
elif is_timedelta64_dtype(dtype):
from pandas import to_timedelta

return astype_nansafe(to_timedelta(arr).values, dtype, copy=copy)
return astype_nansafe(to_timedelta(arr)._values, dtype, copy=copy)

if dtype.name in ("datetime64", "timedelta64"):
msg = (
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/dtypes/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _isna_ndarraylike(obj):
if not is_extension:
# Avoid accessing `.values` on things like
# PeriodIndex, which may be expensive.
values = getattr(obj, "values", obj)
values = getattr(obj, "_values", obj)
else:
values = obj

Expand Down Expand Up @@ -270,7 +270,7 @@ def _isna_ndarraylike(obj):


def _isna_ndarraylike_old(obj):
values = getattr(obj, "values", obj)
values = getattr(obj, "_values", obj)
dtype = values.dtype

if is_string_dtype(dtype):
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7071,7 +7071,7 @@ def asof(self, where, subset=None):

return Series(np.nan, index=self.columns, name=where[0])

locs = self.index.asof_locs(where, ~(nulls.values))
locs = self.index.asof_locs(where, ~(nulls._values))

# mask the missing
missing = locs == -1
Expand Down Expand Up @@ -7230,7 +7230,7 @@ def _clip_with_scalar(self, lower, upper, inplace: bool_t = False):
raise ValueError("Cannot use an NA value as a clip threshold")

result = self
mask = isna(self.values)
mask = isna(self._values)

with np.errstate(all="ignore"):
if upper is not None:
Expand Down Expand Up @@ -8604,7 +8604,7 @@ def _where(

if self.ndim == 1:

icond = cond.values
icond = cond._values

# GH 2745 / GH 4192
# treat like a scalar
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/accessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def __new__(cls, data: "Series"):
orig.array,
name=orig.name,
copy=False,
dtype=orig.values.categories.dtype,
dtype=orig._values.categories.dtype,
)

if is_datetime64_dtype(data.dtype):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def _is_dates_only(self) -> bool:
"""
from pandas.io.formats.format import _is_dates_only

return _is_dates_only(self.values) and self.tz is None
return self.tz is None and _is_dates_only(self._values)

def __reduce__(self):

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,9 @@ def func(self, other, sort=sort):

# GH 19101: ensure empty results have correct dtype
if result.empty:
result = result.values.astype(self.dtype.subtype)
result = result._values.astype(self.dtype.subtype)
else:
result = result.values
result = result._values

return type(self).from_tuples(result, closed=self.closed, name=result_name)

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/indexes/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:

def _mpl_repr(self):
# how to represent ourselves to matplotlib
return self.astype(object).values
return self.astype(object)._values

@property
def _formatter_func(self):
Expand Down Expand Up @@ -389,7 +389,7 @@ def asof_locs(self, where, mask: np.ndarray) -> np.ndarray:
"""
where_idx = where
if isinstance(where_idx, DatetimeIndex):
where_idx = PeriodIndex(where_idx.values, freq=self.freq)
where_idx = PeriodIndex(where_idx._values, freq=self.freq)
elif not isinstance(where_idx, PeriodIndex):
raise TypeError("asof_locs `where` must be DatetimeIndex or PeriodIndex")
elif where_idx.freq != self.freq:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/ops/array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def comp_method_OBJECT_ARRAY(op, x, y):
y = y.astype(np.object_)

if isinstance(y, (ABCSeries, ABCIndex)):
y = y.values
y = y._values

if x.shape != y.shape:
raise ValueError("Shapes must match", x.shape, y.shape)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ def _get_period_bins(self, ax):
def _take_new_index(obj, indexer, new_index, axis=0):

if isinstance(obj, ABCSeries):
new_values = algos.take_1d(obj.values, indexer)
new_values = algos.take_1d(obj._values, indexer)
return obj._constructor(new_values, index=new_index, name=obj.name)
elif isinstance(obj, ABCDataFrame):
if axis == 1:
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/reshape/melt.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ def melt(
if is_extension_array_dtype(id_data):
id_data = concat([id_data] * K, ignore_index=True)
else:
id_data = np.tile(id_data.values, K)
id_data = np.tile(id_data._values, K)
mdata[col] = id_data

mcolumns = id_vars + var_name + [value_name]

mdata[value_name] = frame.values.ravel("F")
mdata[value_name] = frame._values.ravel("F")
for i, col in enumerate(var_name):
# asanyarray will keep the columns as an Index
mdata[col] = np.asanyarray(frame.columns._get_level_values(i)).repeat(N)
Expand Down Expand Up @@ -170,13 +170,13 @@ def lreshape(data: DataFrame, groups, dropna: bool = True, label=None) -> DataFr
pivot_cols = []

for target, names in zip(keys, values):
to_concat = [data[col].values for col in names]
to_concat = [data[col]._values for col in names]

mdata[target] = concat_compat(to_concat)
pivot_cols.append(target)

for col in id_cols:
mdata[col] = np.tile(data[col].values, K)
mdata[col] = np.tile(data[col]._values, K)

if dropna:
mask = np.ones(len(mdata[pivot_cols[0]]), dtype=bool)
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ def _convert_to_mulitindex(index) -> MultiIndex:
if isinstance(index, MultiIndex):
return index
else:
return MultiIndex.from_arrays([index.values], names=[index.name])
return MultiIndex.from_arrays([index._values], names=[index.name])

# For multi-multi joins with one overlapping level,
# the returned index if of type Index
Expand Down Expand Up @@ -1672,10 +1672,10 @@ def flip(xs) -> np.ndarray:

# values to compare
left_values = (
self.left.index.values if self.left_index else self.left_join_keys[-1]
self.left.index._values if self.left_index else self.left_join_keys[-1]
)
right_values = (
self.right.index.values if self.right_index else self.right_join_keys[-1]
self.right.index._values if self.right_index else self.right_join_keys[-1]
)
tolerance = self.tolerance

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/reshape/pivot.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,10 @@ def pivot(data: "DataFrame", index=None, columns=None, values=None) -> "DataFram
if is_list_like(values) and not isinstance(values, tuple):
# Exclude tuple because it is seen as a single column name
indexed = data._constructor(
data[values].values, index=index, columns=values
data[values]._values, index=index, columns=values
)
else:
indexed = data._constructor_sliced(data[values].values, index=index)
indexed = data._constructor_sliced(data[values]._values, index=index)
return indexed.unstack(columns)


Expand Down
8 changes: 4 additions & 4 deletions pandas/core/reshape/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,9 +541,9 @@ def factorize(index):
)

if frame._is_homogeneous_type:
# For homogeneous EAs, frame.values will coerce to object. So
# For homogeneous EAs, frame._values will coerce to object. So
# we concatenate instead.
dtypes = list(frame.dtypes.values)
dtypes = list(frame.dtypes._values)
dtype = dtypes[0]

if is_extension_array_dtype(dtype):
Expand All @@ -554,11 +554,11 @@ def factorize(index):
new_values = _reorder_for_extension_array_stack(new_values, N, K)
else:
# homogeneous, non-EA
new_values = frame.values.ravel()
new_values = frame._values.ravel()

else:
# non-homogeneous
new_values = frame.values.ravel()
new_values = frame._values.ravel()

if dropna:
mask = notna(new_values)
Expand Down
5 changes: 3 additions & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ def count(self, level=None):
level_codes[mask] = cnt = len(lev)
lev = lev.insert(cnt, lev._na_value)

obs = level_codes[notna(self.values)]
obs = level_codes[notna(self._values)]
out = np.bincount(obs, minlength=len(lev) or None)
return self._constructor(out, index=lev, dtype="int64").__finalize__(self)

Expand Down Expand Up @@ -2718,6 +2718,7 @@ def combine(self, other, func, fill_value=None) -> "Series":
if is_categorical_dtype(self.dtype):
pass
elif is_extension_array_dtype(self.dtype):
# TODO: can we do this for only SparseDtype?
# The function can return something of any type, so check
# if the type is compatible with the calling EA.
new_values = try_cast_to_ea(self._values, new_values)
Expand Down Expand Up @@ -3852,7 +3853,7 @@ def f(x):
# GH#23179 some EAs do not have `map`
mapped = self._values.map(f)
else:
values = self.astype(object).values
values = self.astype(object)._values
mapped = lib.map_infer(values, f, convert=convert_dtype)

if len(mapped) and isinstance(mapped[0], Series):
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _map_object(f, arr, na_mask=False, na_value=np.nan, dtype=object):
return np.ndarray(0, dtype=dtype)

if isinstance(arr, ABCSeries):
arr = arr.values
arr = arr._values # TODO: extract_array?
if not isinstance(arr, np.ndarray):
arr = np.asarray(arr, dtype=object)
if na_mask:
Expand Down Expand Up @@ -2034,8 +2034,8 @@ def __init__(self, data):
self._is_categorical = is_categorical_dtype(data)
self._is_string = data.dtype.name == "string"

# .values.categories works for both Series/Index
self._parent = data.values.categories if self._is_categorical else data
# ._values.categories works for both Series/Index
self._parent = data._values.categories if self._is_categorical else data
# save orig to blow up categoricals to the right type
self._orig = data
self._freeze()
Expand Down Expand Up @@ -2236,7 +2236,7 @@ def _get_series_list(self, others):
if isinstance(others, ABCSeries):
return [others]
elif isinstance(others, ABCIndexClass):
return [Series(others.values, index=others)]
return [Series(others._values, index=others)]
elif isinstance(others, ABCDataFrame):
return [others[x] for x in others]
elif isinstance(others, np.ndarray) and others.ndim == 2:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/window/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def zsqrt(x):
mask = x < 0

if isinstance(x, ABCDataFrame):
if mask.values.any():
if mask._values.any():
result[mask] = 0
else:
if mask.any():
Expand Down