79403851

Date: 2025-01-31 19:43:51
Score: 2
Natty:
Report link

Good afternoon, I have a similar situation, and your post helped me a lot. However, my code presents an error when I do not select "COMPANenter code hereY". If you can, give me a tip on how to improve or correct my IF and ELSE. Thanks.

empresas = st.sidebar.multiselect('EMPRESAS', df_vendasveiculos['NotaFiscal_EmpresaNom'].unique(), df_vendasveiculos['NotaFiscal_EmpresaNom'].unique())

vendedores = df_vendasveiculos['NotaFiscal_UsuNomVendedor'].unique() estoques = df_vendasveiculos['NotaFiscal_EstoqueDes'].unique()

if empresas !=[]: vendedores = st.sidebar.multiselect('VENDEDORES', df_vendasveiculos[df_vendasveiculos['NotaFiscal_EmpresaNom'].isin(empresas)]['NotaFiscal_UsuNomVendedor'].unique(), df_vendasveiculos[df_vendasveiculos['NotaFiscal_EmpresaNom'].isin(empresas)]['NotaFiscal_UsuNomVendedor'].unique()) else: st.write("SELECIONE UMA EMPRESA!")

if vendedores !=[]: estoques = st.sidebar.multiselect('ESTOQUES', df_vendasveiculos[df_vendasveiculos['NotaFiscal_UsuNomVendedor'].isin(vendedores)]['NotaFiscal_EstoqueDes'].unique(), df_vendasveiculos[df_vendasveiculos['NotaFiscal_UsuNomVendedor'].isin(vendedores)]['NotaFiscal_EstoqueDes'].unique()) else: st.write("SELECIONE UM VENDEDOR!")

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (1): Good afternoon
  • Blacklisted phrase (1): helped me a lot
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: ALAN JONES