Skip to content

Commit daa1eeb

Browse files
author
Scott Sanderson
committed
MAINT: Use squeeze instead of slicing.
1 parent 1284206 commit daa1eeb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

zipline/data/loader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,15 @@ def ensure_treasury_data(symbol, first_date, last_date, now, environ=None):
295295
def _load_cached_data(filename, first_date, last_date, now, resource_name,
296296
environ=None):
297297
if resource_name == 'benchmark':
298-
# We expect a series here.
299298
def from_csv(path):
300299
return pd.read_csv(
301300
path,
302301
parse_dates=[0],
303302
index_col=0,
304303
header=None,
305-
).tz_localize('UTC').iloc[:, 0]
304+
# Pass squeeze=True so that we get a series instead of a frame.
305+
squeeze=True,
306+
).tz_localize('UTC')
306307
else:
307308
def from_csv(path):
308309
return pd.read_csv(

0 commit comments

Comments
 (0)