This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change some of the variables in room type, prevents errors | |
df.room_type = df.room_type.map({'Private room': 'private_room', | |
'Entire home/apt': 'entire_property', | |
'Shared room': 'shared_room'}) | |
# Adjusts variables for host response times | |
df.host_response_time = df.host_response_time.map({'within an hour': 'lt_hour', | |
'within a few hours': 'lt_few_hours', | |
'within a day': 'lt_day', | |
'a few days or more': 'gt_day'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
# Connect to the SQLite database | |
conn = sqlite3.connect(db_path) | |
# Create a cursor object | |
cur = conn.cursor() | |
# Execute the query | |
query = '''SELECT host_response_time, COUNT(*) AS cnt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Table: order | |
DROP TABLE IF EXISTS orders; | |
CREATE TABLE orders( | |
id int PRIMARY KEY, | |
paymentID int NOT NULL, | |
chargeID int NOT NULL | |
); | |
-- Table: item | |
DROP TABLE IF EXISTS item; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tabulate import tabulate | |
import sqlite3 | |
import json | |
from datetime import datetime | |
con = sqlite3.connect('reids.db') | |
reid_json = json.load(open('reids.json')) | |
cur=con.cursor() | |
order_id = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
We'll need three variables to solve this Eigenvalue Problem (based on a Lesile model): | |
A = the "Leslie matrix" | |
p_i = the initial population breakdown of healthy, sick, and deceased individuals | |
percentage = stop value (percentage of healthy + sick people) | |
''' | |
import numpy as np | |
# Our initial Leslie matrix for the system |