Skip to content

Commit 32c7427

Browse files
committed
Merge pull request #182 from sinhrks/google_quotes
COMPAT: Do not pass iterator as index
2 parents fb4568d + 8ec0b99 commit 32c7427

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pandas_datareader/google/quotes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ def _read_lines(self, out):
2525
buffer = out.read()
2626
m = re.search('// ', buffer)
2727
result = json.loads(buffer[m.start() + len('// '):])
28-
return pandas.DataFrame(map(lambda x: float(x['l']), result),
29-
index=map(lambda x: x['t'], result))
28+
return pandas.DataFrame([float(x['l']) for x in result],
29+
index=[x['t'] for x in result])

pandas_datareader/tests/test_yahoo_options.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
from datetime import datetime
3+
import sys
34

45
import numpy as np
56
from pandas import DataFrame, Timestamp
@@ -13,6 +14,7 @@
1314

1415

1516
class TestYahooOptions(tm.TestCase):
17+
1618
@classmethod
1719
def setUpClass(cls):
1820
super(TestYahooOptions, cls).setUpClass()
@@ -155,6 +157,9 @@ def test_month_year(self):
155157
raise nose.SkipTest(e)
156158

157159
self.assertTrue(len(data) > 1)
160+
161+
if sys.version_info[0] == 2 and sys.version_info[1] == 6:
162+
raise nose.SkipTest('skip dtype check in python 2.6')
158163
self.assertEqual(data.index.levels[0].dtype, 'float64') # GH168
159164

160165
def test_empty_table(self):

0 commit comments

Comments
 (0)