Skip to content

Correct "sentinel" spelling. #5707

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 1 commit into from
Dec 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion doc/source/missing_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Datetimes
---------

For datetime64[ns] types, ``NaT`` represents missing values. This is a pseudo-native
sentinal value that can be represented by numpy in a singular dtype (datetime64[ns]).
sentinel value that can be represented by numpy in a singular dtype (datetime64[ns]).
Pandas objects provide intercompatibility between ``NaT`` and ``NaN``.

.. ipython:: python
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2332,11 +2332,11 @@ def _where_compat(mask, arr1, arr2):
return np.where(mask, arr1, arr2)


def sentinal_factory():
class Sentinal(object):
def sentinel_factory():
class Sentinel(object):
pass

return Sentinal()
return Sentinel()


def in_interactive_session():
Expand Down
16 changes: 8 additions & 8 deletions pandas/core/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ def _column_header():
template = 'colspan="%d" halign="left"'

# GH3547
sentinal = com.sentinal_factory()
levels = self.columns.format(sparsify=sentinal, adjoin=False,
sentinel = com.sentinel_factory()
levels = self.columns.format(sparsify=sentinel, adjoin=False,
names=False)
# Truncate column names
if len(levels[0]) > self.max_cols:
Expand All @@ -750,7 +750,7 @@ def _column_header():
else:
truncated = False

level_lengths = _get_level_lengths(levels, sentinal)
level_lengths = _get_level_lengths(levels, sentinel)

row_levels = self.frame.index.nlevels

Expand Down Expand Up @@ -859,14 +859,14 @@ def _write_hierarchical_rows(self, fmt_values, indent):
if self.fmt.sparsify:

# GH3547
sentinal = com.sentinal_factory()
levels = frame.index[:nrows].format(sparsify=sentinal,
sentinel = com.sentinel_factory()
levels = frame.index[:nrows].format(sparsify=sentinel,
adjoin=False, names=False)
# Truncate row names
if truncate:
levels = [lev[:self.max_rows] for lev in levels]

level_lengths = _get_level_lengths(levels, sentinal)
level_lengths = _get_level_lengths(levels, sentinel)

for i in range(min(len(frame), self.max_rows)):
row = []
Expand Down Expand Up @@ -905,14 +905,14 @@ def _write_hierarchical_rows(self, fmt_values, indent):
self.write_tr(row, indent, self.indent_delta, tags=None)


def _get_level_lengths(levels, sentinal=''):
def _get_level_lengths(levels, sentinel=''):
from itertools import groupby

def _make_grouper():
record = {'count': 0}

def grouper(x):
if x != sentinal:
if x != sentinel:
record['count'] += 1
return record['count']
return grouper
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -2371,16 +2371,16 @@ def format(self, space=2, sparsify=None, adjoin=True, names=False,
sparsify = get_option("display.multi_sparse")

if sparsify:
sentinal = ''
sentinel = ''
# GH3547
# use value of sparsify as sentinal, unless it's an obvious
# use value of sparsify as sentinel, unless it's an obvious
# "Truthey" value
if sparsify not in [True, 1]:
sentinal = sparsify
sentinel = sparsify
# little bit of a kludge job for #1217
result_levels = _sparsify(result_levels,
start=int(names),
sentinal=sentinal)
sentinel=sentinel)

if adjoin:
return com.adjoin(space, *result_levels).split('\n')
Expand Down Expand Up @@ -3379,7 +3379,7 @@ def _wrap_joined_index(self, joined, other):

# For utility purposes

def _sparsify(label_list, start=0, sentinal=''):
def _sparsify(label_list, start=0, sentinel=''):
pivoted = lzip(*label_list)
k = len(label_list)

Expand All @@ -3396,7 +3396,7 @@ def _sparsify(label_list, start=0, sentinal=''):
break

if p == t:
sparse_cur.append(sentinal)
sparse_cur.append(sentinel)
else:
sparse_cur.extend(cur[i:])
result.append(sparse_cur)
Expand Down