Posts

Confused by output from Polyval

Image
up vote 1 down vote favorite I have some data from which I have fitted a 2nd order polynomial using numpy.polynomial.polynomial.polyfit data_fit = poly.polyfit(length_spline_a, temp_spline_b, 2) I am examining changes in length, and have a list of 10% changes in length len_steps = 0.0, -0.012573565669572757, -0.025147131339145513, -0.03772069700871827... print (len(len_steps) >>>>11 My assumption was that polyval would solve for y for each of the x values in the len_steps list y_data = poly.polyval(data_fit, len_steps) However this provides a list with only 3 data points rather than the 11 I expected. print(y_data) >>>>[-5.34112443e+21 -2.50395581e+28 -6.75169134e+28] Have I mis understood the purpose of polyval or have I done something wrong? ...

Canadian federal election, 1935

Image
Canadian federal election, 1935 ← 1930 October 14, 1935 1940 → ← outgoing members 245 seats in the 18th Canadian Parliament 123 seats needed for a majority   First party Second party Third party   Leader W. L. Mackenzie King R. B. Bennett J. H. Blackmore Party Liberal Liberal-Conservative Social Credit Leader since 1919 1927 1935 Leader's seat Prince Albert Calgary West Lethbridge Last election 90 134 pre-creation Seats won 171 39 17 Seat change 83 95 17 Popular vote 1,967,839 1,290,671 180,679 Percentage 44.68% 29.84% 4.10% Swing 0.65pp 18.48pp 4.10pp   Fourth party Fifth party   Leader J. S. Woodsworth H. H. Stevens Party Co-operative Commonwealth Reconstruction Leader since 1932 1935 Leader's seat Winnipeg North Centre Kootenay East Last election pre-creati...