anp-scp commited on
Commit
cefa4e0
1 Parent(s): c1ab7e8

1. Highlighted NOTE with red color; 2. Prevented runtime warnings....

Browse files
Files changed (1) hide show
  1. app.py +15 -7
app.py CHANGED
@@ -130,15 +130,23 @@ ax.yaxis.set_tick_params(labelleft=False)
130
  ax.set_xticks([])
131
  ax.set_yticks([])
132
  fig.legend(bbox_to_anchor=(1.05, 0.86), loc=1, borderaxespad=0., fontsize=8)
 
 
 
 
 
 
 
 
 
 
133
  st.pyplot(fig)
134
 
135
- df = pd.DataFrame({'Eigenvalues': evl, 'Eigenvectors': [str(evec[:,0]), str(evec[:,1])],\
136
  'Transformed Eigenvectors': [str(evec[:,0]*evl[0]), str(evec[:,1]*evl[1])]})
137
- st.table(df.style.format({'Eigenvalues':'{:.2f}'}))
138
 
139
- if np.iscomplex(evl).any() or np.iscomplex(evec).any():
140
- st.write("Due to complex eigenvectors and eigenvalues, the transformed eigenvectors are not\
141
- displayed...")
142
-
143
  file = open("description.md", "r")
144
- st.markdown(file.read())
 
 
130
  ax.set_xticks([])
131
  ax.set_yticks([])
132
  fig.legend(bbox_to_anchor=(1.05, 0.86), loc=1, borderaxespad=0., fontsize=8)
133
+
134
+ if np.iscomplex(evl).any() or np.iscomplex(evec).any():
135
+ st.caption(
136
+ ":red[NOTE: Due to _complex_ _eigenvectors_ and _eigenvalues_, the transformed _eigenvectors_ \
137
+ are not displayed...]"
138
+ )
139
+ else:
140
+ ### This is to make sure that the graph vansish and re-appear whne the condition is true....
141
+ st.caption(" ")
142
+
143
  st.pyplot(fig)
144
 
145
+ df = pd.DataFrame({'Eigenvalues': [str(np.round(x,3)) for x in evl], 'Eigenvectors': [str(evec[:,0]), str(evec[:,1])],\
146
  'Transformed Eigenvectors': [str(evec[:,0]*evl[0]), str(evec[:,1]*evl[1])]})
147
+ st.table(df)
148
 
149
+ st.write("---")
 
 
 
150
  file = open("description.md", "r")
151
+ st.markdown(file.read())
152
+ file.close()