Hello, I’m not able to use the lux library streamlit. can you guide us on how to use below URL library in streamlit? Note: lux library works on jupyter notebook .ipynb file but my code works on .py file
Hi @arjunko, welcome to the Streamlit community!
Based on the README here, this appears to be a Jupyter Notebook/Jupyterlab extension, and as far as I know, no one has written a Streamlit wrapper. Looks like a really useful tool though, would be great if someone in the community wrote a Streamlit component for it!
Hi, Am facing this error for the code that is posted in the demo docs
import pandas as pd
import streamlit as st
import streamlit.components.v1 as components
st.title(‘Analysis of Happy Planet Index Dataset’)
st.write(‘Check out these cool visualizations!’)
df = pd.read_csv(“https://raw.githubusercontent.com/lux-org/lux-datasets/master/data/hpi.csv”)
df.default_display = “lux” # Set Lux as default display
html_content = df.save_as_html()
components.html(html_content, width=800, height=350)
$ conda list
Any help is appreciated.
Doesn’t look like you imported lux in that code.
Try it this way.
import streamlit as st import streamlit.components.v1 as components import pandas as pd import lux def app(): st.title('Analysis of Happy Planet Index Dataset') st.write('Check out these cool visualizations!') df = pd.read_csv("https://raw.githubusercontent.com/lux-org/lux-datasets/master/data/hpi.csv") export_file = 'visualizations.html' df.save_as_html(export_file) html = open(export_file, 'r').read() components.html(html, width=800, height=350) app()