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