Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Flood Prediction
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Intelligent Tank Management System
Flood Prediction
Commits
a629390d
Commit
a629390d
authored
Mar 30, 2022
by
Mohamed Naseef
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
landanalysis
parent
26d5fa8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
0 deletions
+119
-0
landanalysis.py
landanalysis.py
+119
-0
No files found.
landanalysis.py
0 → 100644
View file @
a629390d
import
numpy
as
np
import
seaborn
as
sns
import
matplotlib.pyplot
as
plt
brfss_data
=
np
.
genfromtxt
(
'tankrelatedarea.csv'
,
dtype
=
np
.
int32
,
delimiter
=
','
,
skip_header
=
1
)
print
()
print
(
"First Five land of the Data:"
)
# Indexing starts at 0
print
(
brfss_data
[:
5
,
])
print
(
"area of the land:"
,
brfss_data
.
shape
)
print
()
weight_change
=
brfss_data
[:,
2
]
-
brfss_data
[:,
3
]
print
(
"Descriptive Statistics for hight from tank:"
)
# Calculate & display mean for weight change
land_val
=
np
.
mean
(
weight_change
)
print
(
"Mean:"
,
land_val
.
round
(
decimals
=
2
))
median_val
=
np
.
median
(
weight_change
)
print
(
"Median:"
,
median_val
)
std_dev_val
=
np
.
std
(
weight_change
)
print
(
"Standard Deviation:"
,
std_dev_val
.
round
(
decimals
=
2
))
quartile75
,
quartile25
=
np
.
percentile
(
weight_change
,
[
75
,
25
])
iqr_val
=
quartile75
-
quartile25
print
(
"flood affected area hight Range:"
,
iqr_val
)
print
()
sns
.
displot
(
data
=
weight_change
,
aspect
=
2
,
binwidth
=
4
,
color
=
"purple"
)
plt
.
xlim
(
-
115
,
60
)
plt
.
ylim
(
0
,
7000
)
plt
.
xlabel
(
"areacode Change"
,
fontsize
=
12
)
plt
.
ylabel
(
"hight"
,
fontsize
=
12
)
plt
.
show
()
plt
.
figure
(
figsize
=
(
12
,
8
))
sns
.
scatterplot
(
data
=
weight_change
,
color
=
"red"
,
alpha
=
0.4
)
plt
.
ylabel
(
"area code change"
,
fontsize
=
12
)
plt
.
show
()
brfss_updated
=
np
.
column_stack
((
brfss_data
,
weight_change
))
print
(
"First Five area code hight Changes:"
)
print
(
brfss_updated
[:
5
,
])
print
(
"aria :"
,
brfss_updated
.
shape
)
print
()
split_arr
=
[
brfss_updated
[
brfss_updated
[:,
5
]
==
k
]
for
k
in
np
.
unique
(
brfss_updated
[:,
5
])]
print
(
"not affected land:"
)
print
(
split_arr
[
0
][:
5
,
])
print
(
"area:"
,
split_arr
[
0
]
.
shape
)
print
()
print
(
"Descriptive Statistics for Data relevant land:"
)
land_mean_val
=
np
.
mean
(
split_arr
[
0
])
print
(
"area:"
,
land_mean_val
.
round
(
decimals
=
2
))
land_median_val
=
np
.
median
(
split_arr
[
0
])
print
(
"Median:"
,
land_median_val
)
land_std_dev_val
=
np
.
std
(
split_arr
[
0
])
print
(
"Standard Deviation:"
,
land_std_dev_val
.
round
(
decimals
=
2
))
e_q75
,
e_q25
=
np
.
percentile
(
split_arr
[
0
],
[
75
,
25
])
land_iqr_val
=
e_q75
-
e_q25
print
(
"Interquartile Range:"
,
land_iqr_val
)
print
()
print
(
"not flood area"
)
print
(
split_arr
[
1
][:
5
,
])
print
(
"hight of land:"
,
split_arr
[
1
]
.
shape
)
print
()
print
(
"area not affect"
)
e_n_val
=
np
.
mean
(
split_arr
[
1
])
print
(
"high:"
,
e_n_val
.
round
(
decimals
=
2
))
fe_me_val
=
np
.
median
(
split_arr
[
1
])
print
(
"Median:"
,
fe_me_val
)
tank_std_dev_val
=
np
.
std
(
split_arr
[
1
])
print
(
"Standard Deviation:"
,
tank_std_dev_val
.
round
(
decimals
=
2
))
tank_q75
,
f_q25
=
np
.
percentile
(
split_arr
[
1
],
[
75
,
25
])
e_iqr_val
=
tank_q75
-
f_q25
print
(
"area Range:"
,
e_iqr_val
)
print
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment