Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> stockCorrelate('IBM', 'MSFT') 0.9398712953984427 >>> ================================ RESTART ================================ >>> >>> stockCorrelate('IBM', 'MSFT') opening http://ichart.finance.yahoo.com/table.csv?s=IBM opening http://ichart.finance.yahoo.com/table.csv?s=MSFT 12140 lines from http://ichart.finance.yahoo.com/table.csv?s=IBM 6061 lines from http://ichart.finance.yahoo.com/table.csv?s=MSFT 0.9398712953984427 >>> stockCorrelate('IBM', 'T') opening http://ichart.finance.yahoo.com/table.csv?s=IBM opening http://ichart.finance.yahoo.com/table.csv?s=T 12140 lines from http://ichart.finance.yahoo.com/table.csv?s=IBM 6477 lines from http://ichart.finance.yahoo.com/table.csv?s=T 0.8728562448946126 >>> stockCorrelate('S', 'T') opening http://ichart.finance.yahoo.com/table.csv?s=S opening http://ichart.finance.yahoo.com/table.csv?s=T 6392 lines from http://ichart.finance.yahoo.com/table.csv?s=S 6477 lines from http://ichart.finance.yahoo.com/table.csv?s=T Traceback (most recent call last): File "", line 1, in stockCorrelate('S', 'T') File "/Users/gustavus/Desktop/stockCorrelate.py", line 21, in stockCorrelate assert t1Data[i][0] == t2Data[i][0] AssertionError >>> numbers = [1, 2, 3, 45, 5,333,6] >>> numbers [1, 2, 3, 45, 5, 333, 6] >>> [n*10 for n in numbers] [10, 20, 30, 450, 50, 3330, 60] >>> [n*10 for n in numbers if n < 10] [10, 20, 30, 50, 60] >>> [numbers if n < 10] SyntaxError: invalid syntax (, line 1) >>> [n for n in numbers if n < 10] [1, 2, 3, 5, 6] >>> ================================ RESTART ================================ >>> >>> rostern Traceback (most recent call last): File "", line 1, in rostern NameError: name 'rostern' is not defined >>> roster [['Ben', 'Bauknecht', 'SR', 'San Diego, CA', 'Bartram Trail'], ['Josh', 'Curb', 'SR', 'Bemidji, MN', 'Bemidji'], ['Derrick', 'Davis', 'FY', 'Minneapolis, MN', 'Robbinsdale Cooper'], ['Trevor', 'Gervais', 'FY', 'Fergus Falls, MN', 'Fergus Falls'], ['Ricky', 'Copeland', 'SR', 'Mahtomedi, MN', 'Mahtomedi'], ['Greg', 'Palm', 'SR', 'Orinda, CA', 'Miramonte'], ['Derek', 'Hilding', 'SR', 'Spicer, MN', 'Willmar'], ['Alex', 'Kolquist', 'FY', 'Hermantown', 'Hermantown'], ['Saul', 'Menendez', 'FY', 'Gijon, Asturias, Spain', ''], ['A.J.', 'Olson', 'SR', 'White Bear Lake, MN', 'White Bear Lake'], ['Coby', 'Rowley', 'FY', 'Prior Lake, MN', ''], ['Alex', 'Woodhull', 'SR', 'Minnetonka, MN', 'Minnetonka'], ['Alex', 'Flasch', 'FY', 'Minocqua, WI', 'Lakeland Union'], ['Alex', 'Pederson', 'SO', 'Kiester, MN', 'United South Central']] >>> for player in roster: print(player) ['Ben', 'Bauknecht', 'SR', 'San Diego, CA', 'Bartram Trail'] ['Josh', 'Curb', 'SR', 'Bemidji, MN', 'Bemidji'] ['Derrick', 'Davis', 'FY', 'Minneapolis, MN', 'Robbinsdale Cooper'] ['Trevor', 'Gervais', 'FY', 'Fergus Falls, MN', 'Fergus Falls'] ['Ricky', 'Copeland', 'SR', 'Mahtomedi, MN', 'Mahtomedi'] ['Greg', 'Palm', 'SR', 'Orinda, CA', 'Miramonte'] ['Derek', 'Hilding', 'SR', 'Spicer, MN', 'Willmar'] ['Alex', 'Kolquist', 'FY', 'Hermantown', 'Hermantown'] ['Saul', 'Menendez', 'FY', 'Gijon, Asturias, Spain', ''] ['A.J.', 'Olson', 'SR', 'White Bear Lake, MN', 'White Bear Lake'] ['Coby', 'Rowley', 'FY', 'Prior Lake, MN', ''] ['Alex', 'Woodhull', 'SR', 'Minnetonka, MN', 'Minnetonka'] ['Alex', 'Flasch', 'FY', 'Minocqua, WI', 'Lakeland Union'] ['Alex', 'Pederson', 'SO', 'Kiester, MN', 'United South Central'] >>> frosh = [player for player in roster if player[2]=='FY'] >>> frosh [['Derrick', 'Davis', 'FY', 'Minneapolis, MN', 'Robbinsdale Cooper'], ['Trevor', 'Gervais', 'FY', 'Fergus Falls, MN', 'Fergus Falls'], ['Alex', 'Kolquist', 'FY', 'Hermantown', 'Hermantown'], ['Saul', 'Menendez', 'FY', 'Gijon, Asturias, Spain', ''], ['Coby', 'Rowley', 'FY', 'Prior Lake, MN', ''], ['Alex', 'Flasch', 'FY', 'Minocqua, WI', 'Lakeland Union']] >>> for player in frosh: print(player) ['Derrick', 'Davis', 'FY', 'Minneapolis, MN', 'Robbinsdale Cooper'] ['Trevor', 'Gervais', 'FY', 'Fergus Falls, MN', 'Fergus Falls'] ['Alex', 'Kolquist', 'FY', 'Hermantown', 'Hermantown'] ['Saul', 'Menendez', 'FY', 'Gijon, Asturias, Spain', ''] ['Coby', 'Rowley', 'FY', 'Prior Lake, MN', ''] ['Alex', 'Flasch', 'FY', 'Minocqua, WI', 'Lakeland Union'] >>> frosh.sort() >>> for player in frosh: print(player) ['Alex', 'Flasch', 'FY', 'Minocqua, WI', 'Lakeland Union'] ['Alex', 'Kolquist', 'FY', 'Hermantown', 'Hermantown'] ['Coby', 'Rowley', 'FY', 'Prior Lake, MN', ''] ['Derrick', 'Davis', 'FY', 'Minneapolis, MN', 'Robbinsdale Cooper'] ['Saul', 'Menendez', 'FY', 'Gijon, Asturias, Spain', ''] ['Trevor', 'Gervais', 'FY', 'Fergus Falls, MN', 'Fergus Falls'] >>>