This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| c_list = [] | |
| for col in df.columns[1:]: | |
| c = hv.Area((df.date, df[col]/1e6), 'Date', 'Active Pipeline ($M)', label=col).opts(color=hv.Cycle('Set1')) | |
| c_list.append(c) | |
| hv.Area.stack(hv.Overlay(c_list)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def syncSaveSheets(givenpath, *vsheets, confirm_overwrite=False): | |
| """ | |
| Copy of saveSheets function, but without async stuff | |
| """ | |
| filetype = givenpath.ext or options.save_filetype | |
| savefunc = getattr(vd, 'save_' + filetype, None) or vd.fail('no function to save as type %s' % filetype) | |
| if givenpath.exists() and confirm_overwrite: | |
| confirm("%s already exists. overwrite? " % givenpath.given) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import networkx as nx | |
| G = create_graph() | |
| # Show graph in notebook | |
| A = nx.drawing.nx_agraph.to_agraph(G) | |
| A.layout('dot') | |
| graphviz.Source(A.to_string()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import altair as alt | |
| alt.data_transformers.disable_max_rows() | |
| chart = alt.Chart(df) | |
| chart.mark_line().encode( | |
| x='timestamp:T', | |
| y='ask:Q', | |
| color='strike:O' | |
| ).properties( | |
| width=800, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Example of a plot | |
| c = hv.Curve((x, y)).options(color=hv.Cycle('RdBu')) | |
| # Show valid color cycles | |
| def format_list(l): | |
| print(' '.join(sorted([k for k in l if not k.endswith('_r')]))) | |
| format_list(hv.Cycle.default_cycles.keys()) | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pprint | |
| import sys | |
| sys.displayhook = pprint.pprint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| coverage run --branch -m pytest -v --capture=no --pdb -k partial_test_method_name | |
| coverage report -m -i --include='cash_flow*' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ssh -L<port_on_local_machine>:<remote_machine_as_seen_from_remote_machine>:<port_on_remote_machine> <remote_machine_as_seem_from_local_machine> | |
| # In the example above, all traffic sent to port 5901 on your local host is | |
| # being forwarded to port 4492 on the remote server located at 188.17.0.5. | |
| ssh –L 5901:188.17.0.5:4492 [email protected] | |
| # Another example. This makes it look like a jupyter server on port 8888 of the miner1 host | |
| # is running on port 8888 of your local machine | |
| ssh -L8888:localhost:8888 miner1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from IPython.core.display import display, HTML | |
| display(HTML("<style>.container { width:100% !important; }</style>")) |