-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_data.sh
More file actions
executable file
·26 lines (23 loc) · 1.06 KB
/
update_data.sh
File metadata and controls
executable file
·26 lines (23 loc) · 1.06 KB
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
#Script to update data. This is to update suburb performance statistics data
#We will first look and see if we have started processing before by looking if there is a query_points file available
#If yes start from there and process, otherwise drop table and start from beginning
#read -p "Enter City: " city
#read -p "Database name: " db
#read -p "Bedrooms: " bed
#read -p "Dwelling type (House/Unit): " dwelling
#read -p "Period (Years/Half years/Quarters): " period
#read -p "Number of periods: " nperiod
city=Sydney
db=housing.db
bed='3 4'
dwelling='House Unit'
period=years
nperiod=40
#Check if file exists
if [ -e "query_points_"$city.pkl ]; then
echo "query file exists, will update table"
python3 house_prices.py --database_name=$db --city=$city --fill_table_performance --period=$period --num_periods=$nperiod --bedroom $bed --type $dwelling
else
echo "query file does not exists, will start over"
python3 house_prices.py --reset_table --database_name=$db --city=$city --fill_table_performance --period=$period --num_periods=$nperiod --bedroom $bed --type $dwelling
fi