Skip to content

Commit 0765108

Browse files
author
Carlos Souza
committed
First simplification, code-block in the same place
1 parent bb63964 commit 0765108

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pandas/core/generic.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -3975,12 +3975,10 @@ def asof(self, where, subset=None):
39753975
if nulls.all():
39763976
if is_series:
39773977
return pd.Series(np.nan, index=where, name=self.name)
3978+
elif is_list:
3979+
return pd.DataFrame(np.nan, index=where, columns=self.columns)
39783980
else:
3979-
if is_list:
3980-
return pd.DataFrame(np.nan, index=where,
3981-
columns=self.columns)
3982-
else:
3983-
return pd.Series(np.nan, index=self.columns, name=where[0])
3981+
return pd.Series(np.nan, index=self.columns, name=where[0])
39843982

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

0 commit comments

Comments
 (0)