0

Python dashboard

def make_dashboard(x, gdp_change, unemployment, title, file_name): output_file(file_name) p = figure(title=title, x_axis_label='year', y_axis_label='%') p.line(x.squeeze(), gdp_change.squeeze(), color="firebrick", line_width=4, legend="% GDP change") p.line(x.squeeze(), unemployment.squeeze(), line_width=4, legend="% unemployed") show(p) -------------------- AttributeError Traceback (most recent call last) <ipython-input-60-b89657d5e9d6> in <module> 1 # Fill up the parameters in the following function: ----> 2 make_dashboard(x=1952, gdp_change=6.0, unemployment=3.025000, title='dashboard', file_name='index.html') <ipython-input-55-93fed9a96764> in make_dashboard(x, gdp_change, unemployment, title, file_name) 2 output_file(file_name) 3 p = figure(title=title, x_axis_label='year', y_axis_label='%') ----> 4 p.line(x.squeeze(), gdp_change.squeeze(), color="firebrick", line_width=4, legend="% GDP change") 5 p.line(x.squeeze(), unemployment.squeeze(), line_width=4, legend="% unemployed") 6 show(p) AttributeError: 'int' object has no attribute 'squeeze' How to solve that.

29th Sep 2019, 2:35 PM
Pratik Kumar
Pratik Kumar - avatar
1 Resposta
0
Are you using squeese() function from numpy? If you are using it, maybe import numpy in the first line is a good idea.
29th Sep 2019, 4:17 PM
EagleArisriver
EagleArisriver - avatar