Skip to content

Commit

Permalink
First simplification, code-block in the same place
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Souza committed Mar 25, 2017
1 parent bb63964 commit 0765108
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3975,12 +3975,10 @@ def asof(self, where, subset=None):
if nulls.all():
if is_series:
return pd.Series(np.nan, index=where, name=self.name)
elif is_list:
return pd.DataFrame(np.nan, index=where, columns=self.columns)
else:
if is_list:
return pd.DataFrame(np.nan, index=where,
columns=self.columns)
else:
return pd.Series(np.nan, index=self.columns, name=where[0])
return pd.Series(np.nan, index=self.columns, name=where[0])

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

Expand Down

0 comments on commit 0765108

Please sign in to comment.