Skip to content

CLN: Fix many indentation errors found in #6643. #6646

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
Jun 17, 2014
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
8 changes: 4 additions & 4 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def upload_prev(ver, doc_root='./'):
raise SystemExit('Upload PDF to %s from %s failed' % (ver, doc_root))

def build_pandas():
os.chdir('..')
os.system('python setup.py clean')
os.system('python setup.py build_ext --inplace')
os.chdir('doc')
os.chdir('..')
os.system('python setup.py clean')
os.system('python setup.py build_ext --inplace')
os.chdir('doc')

def build_prev(ver):
if os.system('git checkout v%s' % ver) != 1:
Expand Down
2 changes: 1 addition & 1 deletion pandas/computation/tests/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ def testit(r_idx_type, c_idx_type, index_name):
with warnings.catch_warnings(record=True):
warnings.simplefilter('always', RuntimeWarning)
for r_idx_type, c_idx_type, index_name in args:
testit(r_idx_type, c_idx_type, index_name)
testit(r_idx_type, c_idx_type, index_name)

def test_basic_frame_series_alignment(self):
for engine, parser in ENGINES_PARSERS:
Expand Down
24 changes: 12 additions & 12 deletions pandas/core/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,18 +539,18 @@ def write(buf, frame, column_format, strcols, longtable=False):
buf.write('\\bottomrule\n')
buf.write('\\endlastfoot\n')
if self.escape:
crow = [(x.replace('\\', '\\textbackslash') # escape backslashes first
.replace('_', '\\_')
.replace('%', '\\%')
.replace('$', '\\$')
.replace('#', '\\#')
.replace('{', '\\{')
.replace('}', '\\}')
.replace('~', '\\textasciitilde')
.replace('^', '\\textasciicircum')
.replace('&', '\\&') if x else '{}') for x in row]
crow = [(x.replace('\\', '\\textbackslash') # escape backslashes first
.replace('_', '\\_')
.replace('%', '\\%')
.replace('$', '\\$')
.replace('#', '\\#')
.replace('{', '\\{')
.replace('}', '\\}')
.replace('~', '\\textasciitilde')
.replace('^', '\\textasciicircum')
.replace('&', '\\&') if x else '{}') for x in row]
else:
crow = [x if x else '{}' for x in row]
crow = [x if x else '{}' for x in row]
buf.write(' & '.join(crow))
buf.write(' \\\\\n')

Expand Down Expand Up @@ -2104,7 +2104,7 @@ def detect_console_encoding():

# when all else fails. this will usually be "ascii"
if not encoding or 'ascii' in encoding.lower():
encoding = sys.getdefaultencoding()
encoding = sys.getdefaultencoding()

# GH3360, save the reported defencoding at import time
# MPL backends may change it. Make available for debugging.
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3598,10 +3598,10 @@ def pretty_name(x):
return '%.1f%%' % x

def describe_numeric_1d(series, percentiles):
return ([series.count(), series.mean(), series.std(),
series.min()] +
[series.quantile(x) for x in percentiles] +
[series.max()])
return ([series.count(), series.mean(), series.std(),
series.min()] +
[series.quantile(x) for x in percentiles] +
[series.max()])

def describe_categorical_1d(data):
names = ['count', 'unique']
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -2218,9 +2218,9 @@ def transform(self, func, *args, **kwargs):

# may need to astype
try:
common_type = np.common_type(np.array(res), result)
if common_type != result.dtype:
result = result.astype(common_type)
common_type = np.common_type(np.array(res), result)
if common_type != result.dtype:
result = result.astype(common_type)
except:
pass

Expand Down
16 changes: 8 additions & 8 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,13 +1131,13 @@ def _getitem_axis(self, key, axis=0, validate_iterable=False):
raise NotImplementedError()

def _getbool_axis(self, key, axis=0):
labels = self.obj._get_axis(axis)
key = _check_bool_indexer(labels, key)
inds, = key.nonzero()
try:
return self.obj.take(inds, axis=axis, convert=False)
except Exception as detail:
raise self._exception(detail)
labels = self.obj._get_axis(axis)
key = _check_bool_indexer(labels, key)
inds, = key.nonzero()
try:
return self.obj.take(inds, axis=axis, convert=False)
except Exception as detail:
raise self._exception(detail)

def _get_slice_axis(self, slice_obj, axis=0):
""" this is pretty simple as we just have to deal with labels """
Expand Down Expand Up @@ -1193,7 +1193,7 @@ def _has_valid_type(self, key, axis):
)

elif com._is_bool_indexer(key):
return True
return True

elif _is_list_like(key):

Expand Down
4 changes: 2 additions & 2 deletions pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def eval(self, func, other, raise_on_error=True, try_cast=False):
is_transposed = False
if hasattr(other, 'ndim') and hasattr(values, 'ndim'):
if values.ndim != other.ndim:
is_transposed = True
is_transposed = True
else:
if values.shape == other.shape[::-1]:
is_transposed = True
Expand Down Expand Up @@ -2981,7 +2981,7 @@ def _is_indexed_like(self, other):
def equals(self, other):
self_axes, other_axes = self.axes, other.axes
if len(self_axes) != len(other_axes):
return False
return False
if not all (ax1.equals(ax2) for ax1, ax2 in zip(self_axes, other_axes)):
return False
self._consolidate_inplace()
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ def _set_with(self, key, value):
else:
return self._set_values(key, value)
elif key_type == 'boolean':
self._set_values(key.astype(np.bool_), value)
self._set_values(key.astype(np.bool_), value)
else:
self._set_labels(key, value)

Expand Down
8 changes: 4 additions & 4 deletions pandas/io/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ def _parse_excel(self, sheetname=0, header=0, skiprows=None, skip_footer=0,
year = (value.timetuple())[0:3]
if ((not epoch1904 and year == (1899, 12, 31))
or (epoch1904 and year == (1904, 1, 1))):
value = datetime.time(value.hour,
value.minute,
value.second,
value.microsecond)
value = datetime.time(value.hour,
value.minute,
value.second,
value.microsecond)
else:
# Use the xlrd <= 0.9.2 date handling.
dt = xldate.xldate_as_tuple(value, epoch1904)
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_isnull():
# series
for s in [tm.makeFloatSeries(),tm.makeStringSeries(),
tm.makeObjectSeries(),tm.makeTimeSeries(),tm.makePeriodSeries()]:
assert(isinstance(isnull(s), Series))
assert(isinstance(isnull(s), Series))

# frame
for df in [tm.makeTimeDataFrame(),tm.makePeriodFrame(),tm.makeMixedDataFrame()]:
Expand Down
Loading