-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
329 lines (251 loc) · 16.7 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
import streamlit as st
import pandas as pd
import streamlit.components.v1 as components
from streamlit_option_menu import option_menu
# We Load the dataset
df = pd.read_csv("post partum data set.csv")
# Sidebar
with st.sidebar:
selected = option_menu(
menu_title="Main Menu",
options=[
"Home",
"Know About Post-Partum Depression",
"Diagnosis & Treatments",
"Prevention & Pathology",
"Research Question-1",
"Research Question-2",
"Contributors"
],
default_index=0,
)
#title will be seen on Each Page
st.title("Post Partum Depression")
#containers
homie = st.container()
info = st.container()
bond = st.container()
guilt = st.container()
people= st.container()
# Home Page
if selected == "Home":
st.markdown("""
<style>
.big-font {
font-size:30px !important;
}
</style>
""", unsafe_allow_html=True)
st.header("Welcome to our Application!")
#dataframe
st.divider()
st.subheader("Click to observe Dataset")
with st.expander("Dataframe"):
st.text("Here is the dataset that has been used in this Analysis : ")
st.dataframe(df, height=600, width=1200)
st.divider()
st.image("Maa.jpg",width=650)
st.divider()
st.header("What is Postpartum Depression Analysis ?")
st.markdown("""
Postpartum analysis is the examination of a woman's physical and mental health during the period after childbirth. This analysis is important for identifying and treating any potential complications that may arise from the delivery of the baby.
""")
st.divider()
st.subheader("Take the Below Quiz to Anaylyse your Mental Health")
st.markdown('<p class="big-font"><a href="https://hci-post-partum.netlify.app/">Take Quiz Now</a></p>', unsafe_allow_html=True)
# Causes Page
elif selected == "Know About Post-Partum Depression":
st.divider()
st.header("What could be the Causes & Symptoms for this ?")
st.divider()
st.subheader("Causes of Postpartum Complications")
st.markdown("""
- **Hormonal changes:** After childbirth, there is a rapid decline in estrogen and progesterone levels. This can lead to physical and emotional symptoms, including mood swings, depression, and anxiety.
- **Emotional factors:** Stress, sleep deprivation, and lifestyle adjustments can all contribute to postpartum emotional challenges.
- **Physical changes:** The body is recovering from the trauma of childbirth, and there may be a number of physical changes, such as pain, bleeding, and fatigue.
- **Bleeding:** Excessive bleeding is a common complication of childbirth. It can be caused by a number of factors, including retained placenta, uterine atony, and lacerations.
- **Infection:** Infections can occur in the uterus, urinary tract, or at incision sites. They can be serious and even life-threatening.
- **Blood clots:** Blood clots can form in the legs, lungs, or abdomen after childbirth. They can be life-threatening.
- **Mental health problems:** Postpartum mental health problems are common, and they can range from mild to severe. They include baby blues, postpartum depression, and postpartum psychosis.
""")
st.divider()
st.subheader("Symptoms of Postpartum Complications")
st.markdown("""
- Excessive bleeding
- Fever
- Pain
- Redness, swelling, or pus
- Difficulty breastfeeding
- Baby blues
- Postpartum depression
- Postpartum anxiety
- Postpartum psychosis
""")
# Diagnosis Page
elif selected == "Diagnosis & Treatments":
st.divider()
st.header(" What to do now?")
st.divider()
st.subheader("Diagnosis of Postpartum Complications")
st.markdown(
body= """
<p>
<strong>Edinburgh Postnatal Depression Scale (EPDS):</strong>
The EPDS is a questionnaire that can be used to screen for postpartum depression.
</p>
<ul>
<li><strong>Blood tests:</strong> Blood tests can be used to check for infection, anemia, and other problems.</li>
<li><strong>Ultrasound:</strong> Ultrasound can be used to visualize the uterus and other reproductive organs.</li>
<li><strong>X-ray:</strong> X-rays can be used to check for fractures or other injuries.</li>
</ul>""", unsafe_allow_html=True)
st.divider()
st.subheader("Treatment for Postpartum Complications")
st.markdown("""
- **Bed rest:** Bed rest may be recommended for women with excessive bleeding or infection.
- **Medications:** Antibiotics are used to treat infection, and pain medication is used to relieve pain.
- **Surgery:** Surgery may be necessary to remove a retained placenta, repair a laceration, or treat a blood clot.
- **Therapy:** Therapy can be helpful for women with postpartum depression or anxiety.
- **Medication:** Medication may be prescribed for women with severe postpartum depression or anxiety.
""")
# Prevention & Pathology
elif selected == "Prevention & Pathology":
st.divider()
st.header(" What are the Prevention & Pathology? ")
st.divider()
st.subheader("Prevention of Postpartum Complications")
st.markdown("""
- Getting regular prenatal care
- Eating a healthy diet
- Getting enough rest
- Talking to a healthcare provider about any concerns
""")
st.divider()
st.subheader("Pathology of Postpartum Mental Health Conditions")
st.markdown("""
The development of postpartum mental health conditions is a complex process that involves a number of factors, including hormonal changes, psychological factors, and social factors. The transition from pregnancy to postpartum can be a stressful time for women, and this stress can contribute to the development of mental health problems.
""")
# Analysis - 1
elif selected == "Research Question-1":
st.divider()
st.header("How Sleeping affects Bonding & Concentration in Post-Partum Depression ?")
st.divider()
# Tableau Public Dashboard
html_DashBoard1 = """<div class='tableauPlaceholder' id='viz1701200066433' style='position: relative'><noscript><a href='#'><img alt=' ' src='https://public.tableau.com/static/images/Po/PostPartumDepression_17008109983390/Dashboard2/1_rss.png' style='border: none' /></a></noscript><object class='tableauViz' style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='PostPartumDepression_17008109983390/Dashboard2' /><param name='tabs' value='yes' /><param name='toolbar' value='yes' /><param name='static_image' value='https://public.tableau.com/static/images/Po/PostPartumDepression_17008109983390/Dashboard2/1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /><param name='language' value='en-US' /></object></div> <script type='text/javascript'> var divElement = document.getElementById('viz1701200066433'); var vizElement = divElement.getElementsByTagName('object')[0]; vizElement.style.width='1300px';vizElement.style.height='950px'; var scriptElement = document.createElement('script'); scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js'; vizElement.parentNode.insertBefore(scriptElement, vizElement); </script>"""
components.html(html_DashBoard1, width=1300, height=1000)
st.divider()
st.subheader("Obeservations")
st.markdown("""## Key Details:
### General:
- **Post-Partum Women's Emotions:**
- Irritation and one-sided connection with the baby are common post-partum issues.
- Sleep problems lasting two or more days are prevalent.
- Causes: Attributed to the baby or depression.
- **Age-Related Observations:**
- Irritation towards the baby and partner increases but decreases after age 45.
- Suggested reason for the decline: Maturity.
### Age Groups:
#### 25-30:
- **Sleep and Connection with Baby:**
- Lack of sleep affects the connection with the baby, especially if decision-making is impaired.
- General association of connection issues and irritation, heightened with less sleep and impaired decision-making.
- Higher irritation towards baby and partner may be due to the youthfulness of this age group.
#### 30-35:
- **Maturity Impact:**
- Some maturity observed, as sleep-deprived mothers can still bond with the baby.
- Impaired decision-making with low sleep leads to irritability.
- Sleep deprivation is common but does not necessarily impair decision-making.
#### 35-40:
- **Sleep Deprivation and Irritation:**
- Sleep deprivation in this age group is linked to irritation and connection issues.
- Sleep is crucial due to the proneness to irritation.
- Decision impairment is common with lack of sleep.
#### 40-45:
- **Sleep Deprivation and Decision Making:**
- Sleep deprivation is present, but less decision-making impairment compared to other age groups.
- Highest irritation towards partner and baby, but they can still connect with the baby.
#### 45-50:
- **Maturity and Decision Making:**
- High maturity observed; easy decision-making even with no sleep for two days.
- Minimal to no decision-making impairment.
- Reduced irritation towards partner and baby.
"""
)
# Analysis - 2
elif selected == "Research Question-2":
st.divider()
st.header("Does Guilt increases Anxiousness & affect there Diet ?")
st.divider()
# Tableau Public Dashboard
html_DashBoard2 = """<div class='tableauPlaceholder' id='viz1701199925161' style='position: relative'><noscript><a href='#'><img alt=' ' src='https://public.tableau.com/static/images/Po/PostPartumDepression_17008109983390/Dashboard3/1_rss.png' style='border: none' /></a></noscript><object class='tableauViz' style='display:none;'><param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' /> <param name='embed_code_version' value='3' /> <param name='site_root' value='' /><param name='name' value='PostPartumDepression_17008109983390/Dashboard3' /><param name='tabs' value='yes' /><param name='toolbar' value='yes' /><param name='static_image' value='https://public.tableau.com/static/images/Po/PostPartumDepression_17008109983390/Dashboard3/1.png' /> <param name='animate_transition' value='yes' /><param name='display_static_image' value='yes' /><param name='display_spinner' value='yes' /><param name='display_overlay' value='yes' /><param name='display_count' value='yes' /><param name='language' value='en-US' /></object></div> <script type='text/javascript'> var divElement = document.getElementById('viz1701199925161'); var vizElement = divElement.getElementsByTagName('object')[0]; if ( divElement.offsetWidth > 800 ) { vizElement.style.minWidth='1300px';vizElement.style.maxWidth='100%';vizElement.style.minHeight='950px';vizElement.style.maxHeight=(divElement.offsetWidth*0.75)+'px';} else if ( divElement.offsetWidth > 500 ) { vizElement.style.minWidth='1300px';vizElement.style.maxWidth='100%';vizElement.style.minHeight='950px';vizElement.style.maxHeight=(divElement.offsetWidth*0.75)+'px';} else { vizElement.style.minWidth='1300px';vizElement.style.maxWidth='100%';vizElement.style.minHeight='950px';vizElement.style.maxHeight=(divElement.offsetWidth*1.77)+'px';} var scriptElement = document.createElement('script'); scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js'; vizElement.parentNode.insertBefore(scriptElement, vizElement); </script>"""
components.html(html_DashBoard2, width=1500, height=1000)
st.divider()
st.subheader("Obeservations")
st.markdown("""### Age Group 25-30:
#### 1. Anxiety and Appetite:
- **Finding:** 33.15% of women in this age group are anxious, but it doesn't significantly impact their appetite.
- **Observation:** Anxiety seems to coexist without a direct effect on eating habits.
#### 2. Guilt and Sadness:
- **Finding:** Majority of women feeling guilty don't feel sad.
- **Observation:** Guilt may not directly contribute to sadness.
#### 3. Suicide Attempts:
- **Finding:** Suicide attempts are relatively low.
- **Observation:** Despite anxiety and guilt, effective coping mechanisms may be in place.
### 30-35:
#### 1. Anxiety and Appetite:
- **Finding:** 43.25% of women are not anxious, and it doesn't impact their appetite significantly.
- **Observation:** Anxiety is less prevalent and minimally affects eating habits.
#### 2. Guilt and Sadness:
- **Finding:** Majority of guilty women don't feel sad.
- **Observation:** Similar to the younger age group, guilt may not strongly correlate with sadness.
#### 3. Suicide Attempts:
- **Finding:** Suicide attempts are less frequent.
- **Observation:** Despite some anxiety, women in this age group show resilience against severe outcomes.
### Age Group 35-40:
#### 1. Anxiety and Appetite:
- **Finding:** 40.11% of women experience anxiety, but it doesn't affect appetite significantly.
- **Observation:** Anxiety doesn't strongly influence eating habits.
#### 2. Guilt and Sadness:
- **Finding:** Majority of women feeling guilty don't feel sad.
- **Observation:** Consistent with younger groups, guilt may not directly lead to sadness.
#### 3. Suicide Attempts:
- **Finding:** Higher rates of suicide attempts.
- **Observation:** Increased suicide attempts suggest a need for targeted mental health interventions.
### Age Group 45-50:
#### 1. Anxiety and Appetite:
- **Finding:** 43.68% of women experience anxiety, but it doesn't affect appetite significantly.
- **Observation:** Similar to the 35-40 group, anxiety doesn't strongly correlate with changes in appetite.
#### 2. Guilt and Sadness:
- **Finding:** Majority of guilty women don't feel sad.
- **Observation:** Guilt doesn't significantly contribute to sadness in this age group.
#### 3. Suicide Attempts:
- **Finding:** Higher rates of suicide attempts.
- **Observation:** High prevalence of suicide attempts emphasizes the need for mental health support.
## General Observations:
#### 1. Consistent Trends:
- Across age groups, the majority of women feeling guilty do not report feeling sad.
#### 2. Appetite and Anxiety:
- Anxiety, in general, does not appear to have a profound impact on appetite across age groups.
#### 3. Suicide Attempts:
- Notable suicide attempts in the 35-50 age range highlight a critical need for mental health interventions and support.
#### 4. Individual Coping Strategies:
- Despite anxiety and guilt, some women demonstrate resilience, as indicated by lower suicide attempt rates.
#### 5. Recommendations:
- Develop targeted mental health interventions for women in the 35-50 age range.
- Explore and promote effective coping mechanisms identified in groups with lower suicide attempt rates.
""")
#Contributors Page
elif selected == "Contributors":
st.title("Postpartum Analysis - Contributors")
st.subheader("Contributors")
st.markdown("""
- 21BCE1887 – SHASHANK KUMAR
- 21BCE1349 – KARTHIK R
""")
st.divider()
st.subheader("Link to the Resources")
st.markdown("""
- [A Comprehensive Analysis of Post-partum Depression Risk Factors: The Role of Socio-Demographic, Individual, Relational, and Delivery Characteristics](https://pubmed.ncbi.nlm.nih.gov/31709213/)
- [Situational analysis to scale up and sustain postpartum family planning services in Niger](https://www.who.int/publications/m/item/situational-analysis-to-scale-up-and-sustain-postpartum-family-planning-services-in-niger)
- [Postpartum depression and associated factors among mothers who gave birth in the last twelve months in Ankesha district, Awi zone, North West Ethiopia](https://bmcpregnancychildbirth.biomedcentral.com/articles/10.1186/s12884-019-2594-y)
- [Optimizing Postpartum Care](https://www.acog.org/clinical/clinical-guidance/committee-opinion/articles/2018/05/optimizing-postpartum-care)
""")