Repository: pandas-dev/pandas

Issue:
Sentinal -> Sentinel
I was working on some typo fixes, and noticed that "Sentinel" is misspelled "Sentinal" in a few user-visible places (function names, arguments).  Seems unlikely that anyone's relying on this, though, and it would produce a noisy and easily fixed error if so after the change.

```
./pandas/core/common.py:def sentinal_factory():
./pandas/core/common.py:    class Sentinal(object):
./pandas/core/common.py:    return Sentinal()
./pandas/core/format.py:            sentinal = com.sentinal_factory()
./pandas/core/format.py:            levels = self.columns.format(sparsify=sentinal, adjoin=False,
./pandas/core/format.py:            level_lengths = _get_level_lengths(levels, sentinal)
./pandas/core/format.py:            sentinal = com.sentinal_factory()
./pandas/core/format.py:            levels = frame.index[:nrows].format(sparsify=sentinal,
./pandas/core/format.py:            level_lengths = _get_level_lengths(levels, sentinal)
./pandas/core/format.py:def _get_level_lengths(levels, sentinal=''):
./pandas/core/format.py:            if x != sentinal:
./pandas/core/index.py:            sentinal = ''
./pandas/core/index.py:            # use value of sparsify as sentinal,  unless it's an obvious
./pandas/core/index.py:                sentinal = sparsify
./pandas/core/index.py:                                      sentinal=sentinal)
./pandas/core/index.py:def _sparsify(label_list, start=0, sentinal=''):
./pandas/core/index.py:                sparse_cur.append(sentinal)
./doc/source/missing_data.rst:sentinal value that can be represented by numpy in a singular dtype (datetime64[ns]).
```



Discussion:

Resolving patch:
diff --git a/pandas/core/common.py b/pandas/core/common.py
--- a/pandas/core/common.py
+++ b/pandas/core/common.py
@@ -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():
diff --git a/pandas/core/format.py b/pandas/core/format.py
--- a/pandas/core/format.py
+++ b/pandas/core/format.py
@@ -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:
@@ -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
 
@@ -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 = []
@@ -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
diff --git a/pandas/core/index.py b/pandas/core/index.py
--- a/pandas/core/index.py
+++ b/pandas/core/index.py
@@ -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')
@@ -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)
 
@@ -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)


Test patch: