Session 4: Assignment

Contents

Session 4: Assignment#

Create visualizations instructed in each cell

# Import modules
from pyincore import FragilityService, IncoreClient, FragilityCurveSet, MappingSet, Dataset

from pyincore_viz.plotutil import PlotUtil as plot
from pyincore_viz.geoutil import GeoUtil as geoviz
# Connect to IN-CORE serivce by creating IncoreClient
client = IncoreClient()
# Exercise 1: 
# TODO: create a local dataset for building inventory with shapefiles ("sample_bldgs_w_guid.shp")
# TODO: dataset type: "ergo:buildingInventoryVer7"


# TODO: acquire GeoDataFrame object from the dataset
# Exercise 2: 
# TODO: create a local dataset for building damage output with CSV ("memphis_eq_bldg_dmg_result.csv") - it should be in your browser if you ran session 4 notebook.
# TODO: dataset type: "ergo:buildingDamageVer5"


# TODO: acquire DataFrame object from the dataset
# Exercise 3: 
# TODO: Join/merge building inventory GeoDataframe and damage output Dataframe
# Exercise 4: 
# TODO: Using joined GeoDataFrame, 
# TODO: Display the table grouped by "struct_type" and showing sum of apprasial value of buildings "appr_bldg" 
# Exercise 5: 
# TODO: Using joined GeoDataFrame,
# TODO: Plot a pie chart of (DS_0, DS_1, DS_2, DS_3) with a building with highest value of DS_3. 
#       Use for example Panda's pie chart method
# Exercise 6: 
# TODO: Using joined GeoDataFrame,
# TODO: Display a table of buidings with DS_3 >= 0.05 and sorted by DS_3
# Exercise 7: 
# TODO: Using joined GeoDataFrame,
# TODO: Plot a map of buidings with DS_3 >= 0.05 and sorted by DS_3

Answers#

Please open session4-assignment-answer.ipynb.