Add current datapoint & format
This commit is contained in:
parent
a6325468ca
commit
3953d6d2ff
4
plot.py
4
plot.py
@ -13,7 +13,9 @@ def main(folder: str = "plots"):
|
||||
timestamp = timestamp.replace(":", "-")
|
||||
plot_df = create_plot_df(datetime.datetime.now(), _df_state)
|
||||
print(plot_df.sum(1))
|
||||
fig.savefig(Path(folder) / f"digital_plot_{timestamp}.png", dpi=300, bbox_inches='tight')
|
||||
fig.savefig(
|
||||
Path(folder) / f"digital_plot_{timestamp}.png", dpi=300, bbox_inches="tight"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -10,10 +10,24 @@ import numpy as np
|
||||
import pandas as pd
|
||||
import scipy
|
||||
|
||||
from wsgi import create_fig, create_plot_df, plot
|
||||
from wsgi import create_fig, create_plot_df, get_tables, plot
|
||||
|
||||
|
||||
def create_dfs():
|
||||
def create_dfs(url: str = "https://beschaeftigtenbefragung.verdi.de/"):
|
||||
try:
|
||||
curr_datetime = datetime.datetime.now()
|
||||
df, df_state = get_tables(url)
|
||||
|
||||
df = df.sort_values(
|
||||
["Digitale Befragung", "Bundesland", "Bezirk"],
|
||||
ascending=[False, True, True],
|
||||
)
|
||||
|
||||
df_state = df_state.sort_values("Landesbezirk")
|
||||
plot_df = create_plot_df(curr_datetime, df_state)
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
last_file = sorted(Path("data").iterdir())[-1]
|
||||
key = last_file.name[:10]
|
||||
|
||||
@ -108,7 +122,7 @@ def main():
|
||||
|
||||
plt.gca().set_xticks([target_time])
|
||||
plt.title("Projektion Teilnahme an Digitaler Beschäftigtenbefragung")
|
||||
plt.savefig("plots/regression.png", bbox_inches='tight', dpi=300)
|
||||
plt.savefig("plots/regression.png", bbox_inches="tight", dpi=300)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user