-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
34 lines (27 loc) · 1014 Bytes
/
main.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
import PyPDF2
import pandas as pd
from io import StringIO
import re
import matplotlib.pyplot as plt
from utils.func_utils import Utils
pdf_path = './data/fseprd1162873.pdf'
txt_path = './data/fseprd1162873.txt'
csv_path = './data/fseprd1162873.csv'
utils = Utils()
# utils.read_pdf_to_txt(pdf_path, txt_path)
# utils.clean_txt_file(txt_path)
df = utils.read_txt_to_df(txt_path, csv_path, save_csv=True)
# Get only July dates of interest
df = df[(df['application_date'] >= '2023-07-20') & (df['application_date'] <= '2023-07-21')]
# Print heat map of lottery permit day odds
# utils.plot_heatmap(df)
# Print bar plot of lotter permit day odds
# utils.plot_barplot(df)
# Sample lottery selections
lottery_dic = [
{'date': '2023-07-20', 'zone':'Snow Zone', 'n': 1},
{'date': '2023-07-21', 'zone':'Snow Zone', 'n': 1},
{'date': '2023-07-22', 'zone':'Stuart Zone', 'n': 1}
]
# Print distribution plot of expected permit odds
utils.plot_distribution(df, lottery_dic, simulations=1000)