redfernstech commited on
Commit
c019334
·
verified ·
1 Parent(s): d303646

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -57,7 +57,6 @@ elif option == "Plots":
57
 
58
  # Display the plot in Streamlit
59
  st.pyplot(fig)
60
- # Notebook Page: Render the Jupyter Notebook
61
  elif option == "Notebook":
62
  st.title("Jupyter Notebook")
63
 
@@ -65,13 +64,22 @@ elif option == "Notebook":
65
  notebook_path = 'upwork_dashboard.ipynb' # Update with the actual path to your notebook
66
  with open(notebook_path) as f:
67
  notebook_content = nbformat.read(f, as_version=4)
68
-
 
 
 
 
 
 
 
 
69
  html_exporter = HTMLExporter()
70
  html_exporter.exclude_input = False # Include code cells in the notebook display
71
  notebook_html, _ = html_exporter.from_notebook_node(notebook_content)
72
 
73
  # Display the notebook HTML in Streamlit
74
  html(notebook_html, height=800, scrolling=True)
 
75
  elif option == "Download Datasets":
76
  st.title("Download Datasets")
77
  d=pd.read_csv("category upwork jobs.csv")
 
57
 
58
  # Display the plot in Streamlit
59
  st.pyplot(fig)
 
60
  elif option == "Notebook":
61
  st.title("Jupyter Notebook")
62
 
 
64
  notebook_path = 'upwork_dashboard.ipynb' # Update with the actual path to your notebook
65
  with open(notebook_path) as f:
66
  notebook_content = nbformat.read(f, as_version=4)
67
+
68
+ # Create a new markdown cell with the link to the Google Colab notebook
69
+ colab_link = "[Open in Google Colab](https://colab.research.google.com/drive/1qoTldQ-Kr6DgePRNYgdlQqqHq5JQax0h?usp=sharing)"
70
+ new_cell = nbformat.v4.new_markdown_cell(colab_link)
71
+
72
+ # Insert the new cell at the top of the notebook
73
+ notebook_content.cells.insert(0, new_cell)
74
+
75
+ # Export the notebook to HTML
76
  html_exporter = HTMLExporter()
77
  html_exporter.exclude_input = False # Include code cells in the notebook display
78
  notebook_html, _ = html_exporter.from_notebook_node(notebook_content)
79
 
80
  # Display the notebook HTML in Streamlit
81
  html(notebook_html, height=800, scrolling=True)
82
+ # Notebook Page: Render the Jupyter Notebook
83
  elif option == "Download Datasets":
84
  st.title("Download Datasets")
85
  d=pd.read_csv("category upwork jobs.csv")