I would like to change the vertical number input to column number input
Steps to reproduce
Code snippet:
import numpy as np
import streamlit as st
st.header('Input Data')
p = np.array([[4,3,6,2],[1,4,3,5],[2,5,2,3],[5,2,4,1],[3,6,1,4]])
st.dataframe(p)
t = []
tb = len(p)
st.subheader('Enter the T value into row for multiplication')
for i in range(tb):
value = st.number_input(f'row{i}:', min_value=0, max_value=10, step=1)
t.append(value)
t = np.array(t)
t = np.tile(t, (p.shape[1], 1)).T
p_mod = np.multiply(p, t)
st.header('Output Data')
st.dataframe(p_mod)
Explain what you expect to happen when you run the code above.
Suppose If I run the above code I would get the number input in vertical order but I would like to have in horizontal order
len(p) is the number of columns, not the column size.
If you add a row to p then len(p) will increase and the number of columns will increase too and the column size will decrease to accommodate more columns.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.