GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( ff8ead...b2b3b2 )
by
unknown
01:30
created

table.generate_table()   A

Complexity

Conditions 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nop 2
1
import dash
2
import dash_core_components as dcc
3
import dash_html_components as html
4
import pandas as pd
5
6
df = pd.read_csv(
7
    'https://gist.githubusercontent.com/chriddyp/'
8
    'c78bf172206ce24f77d6363a2d754b59/raw/'
9
    'c353e8ef842413cae56ae3920b8fd78468aa4cb2/'
10
    'usa-agricultural-exports-2011.csv')
11
12
13
def generate_table(dataframe, max_rows=10):
14
    return html.Table(
15
        # Header
16
        [html.Tr([html.Th(col) for col in dataframe.columns])] +
17
18
        # Body
19
        [html.Tr([
20
            html.Td(dataframe.iloc[i][col]) for col in dataframe.columns
21
        ]) for i in range(min(len(dataframe), max_rows))]
22
    )
23
24
25
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
26
27
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
28
29
app.layout = html.Div(children=[
30
    html.H4(children='US Agriculture Exports (2011)'),
31
    generate_table(df)
32
])
33
34
if __name__ == '__main__':
35
    app.run_server(debug=True)
36