Skip to content

Commit

Permalink
MAINT: Use squeeze instead of slicing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Sanderson committed Jul 17, 2018
1 parent 1284206 commit daa1eeb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zipline/data/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,15 @@ def ensure_treasury_data(symbol, first_date, last_date, now, environ=None):
def _load_cached_data(filename, first_date, last_date, now, resource_name,
environ=None):
if resource_name == 'benchmark':
# We expect a series here.
def from_csv(path):
return pd.read_csv(
path,
parse_dates=[0],
index_col=0,
header=None,
).tz_localize('UTC').iloc[:, 0]
# Pass squeeze=True so that we get a series instead of a frame.
squeeze=True,
).tz_localize('UTC')
else:
def from_csv(path):
return pd.read_csv(
Expand Down

0 comments on commit daa1eeb

Please sign in to comment.