Spaces:
Runtime error
Runtime error
File size: 578 Bytes
1fcb538 9131bec 1fcb538 9131bec |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import streamlit as st
import numpy as np
import matplotlib.pyplot as plt
number_of_observations = st.slider('Number of observations', min_value=50, max_value=150)
X = np.column_stack((np.ones(number_of_observations),
np.random.random(number_of_observations))
fig = plt.figure(dpi=80, figsize=(7,7))
ax = fig.add_subplot(111)
ax.set_xlim((0,1))
ax.set_ylim((-5,20))
plt.scatter(X[:,1], y, c='r', edgecolors='#fda172')
line_thickness = 2
line, = ax.plot([], [], lw=line_thickness)
st.pyplot(fig)
st.write(X[:5, :]) |