Spaces:
Sleeping
Sleeping
Charles De Dampierre
commited on
Commit
•
e218e4c
1
Parent(s):
026a3b5
commit results
Browse files- __pycache__/region_list.cpython-311.pyc +0 -0
- app.py +96 -41
- data/immaterial_index/figures_trends_R/results/Chinese world.png +3 -0
- data/immaterial_index/figures_trends_R/results/Greek World.png +3 -0
- data/immaterial_index/figures_trends_R/results/Indian world.png +3 -0
- data/immaterial_index/figures_trends_R/results/Latin World.png +3 -0
- data/immaterial_index/figures_trends_R/results/Low countries.png +3 -0
- data/immaterial_index/figures_trends_R/results/Nordic countries.png +3 -0
- data/immaterial_index/figures_trends_R/results/Slav world.png +3 -0
- data/immaterial_index/figures_trends_R/results/United Kingdom.png +3 -0
- data/immaterial_index/figures_trends_R/results/Western Europe.png +3 -0
- data/immaterial_index/figures_trends_R/results/ancient_med.png +2 -2
- data/immaterial_index/figures_trends_R/results/byzance.png +2 -2
- data/immaterial_index/figures_trends_R/results/china_north_south.png +2 -2
- data/immaterial_index/figures_trends_R/results/europe_north_south.png +2 -2
- data/immaterial_index/figures_trends_R/results/france.png +2 -2
- data/immaterial_index/figures_trends_R/results/india_north_south.png +2 -2
- data/immaterial_index/figures_trends_R/results/italy.png +2 -2
- data/immaterial_index/figures_trends_R/results/japan.png +2 -2
- data/immaterial_index/figures_trends_R/results/japan_north_south.png +2 -2
- data/immaterial_index/figures_trends_R/results/mena.png +2 -2
- data/immaterial_index/figures_trends_R/results/mena_persian_arab.png +2 -2
- data/immaterial_index/figures_trends_R/results/spain.png +2 -2
- data/immaterial_index/figures_trends_R/results/yangtze.png +2 -2
- data/immaterial_index/figures_trends_R/results_per_capita/Italy.png +3 -0
- data/immaterial_index/figures_trends_R/results_per_capita/Japan.png +3 -0
- project.toml +1 -0
- region_list.py +34 -35
- regions.toml +32 -0
__pycache__/region_list.cpython-311.pyc
ADDED
Binary file (2.13 kB). View file
|
|
app.py
CHANGED
@@ -2,9 +2,14 @@ import streamlit as st
|
|
2 |
from PIL import Image
|
3 |
import os
|
4 |
import pandas as pd
|
|
|
5 |
|
|
|
6 |
|
7 |
-
|
|
|
|
|
|
|
8 |
def load_data():
|
9 |
df_ind = pd.read_csv("data/df_individuals_score.csv", index_col=[0])
|
10 |
df_ind = df_ind.drop("region_code", axis=1)
|
@@ -14,13 +19,30 @@ def load_data():
|
|
14 |
].astype(str)
|
15 |
|
16 |
df_ind = df_ind[df_ind["productive_year"] <= 1800]
|
17 |
-
|
18 |
return df_ind
|
19 |
|
20 |
|
21 |
df_ind = load_data()
|
22 |
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
# Set the global index path
|
26 |
global_index_path = "data/immaterial_index/figures_trends_R/results"
|
@@ -41,6 +63,8 @@ maps_path = "data/map_figures"
|
|
41 |
|
42 |
from region_list import region_list
|
43 |
|
|
|
|
|
44 |
index_paths = {}
|
45 |
|
46 |
for region_key in region_list:
|
@@ -62,9 +86,9 @@ selected_region = st.sidebar.selectbox("Region:", regions, index=regions.index("
|
|
62 |
|
63 |
# Display the selected region's images vertically
|
64 |
if selected_region in index_paths:
|
|
|
65 |
|
66 |
df = df_ind[df_ind["region_name"] == selected_region]
|
67 |
-
df["productive_year"] = round(df["productive_year"], 0)
|
68 |
df = df.drop(["region_name", "decade"], axis=1)
|
69 |
df = df[
|
70 |
[
|
@@ -76,43 +100,74 @@ if selected_region in index_paths:
|
|
76 |
]
|
77 |
df = df.sort_values("score", ascending=False)
|
78 |
df = df.rename(columns={"score": "Number of Catalogs"})
|
79 |
-
df = df.reset_index(drop=True)
|
80 |
-
st.dataframe(df)
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
|
|
|
|
86 |
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
)
|
117 |
-
|
118 |
-
|
|
|
|
|
|
2 |
from PIL import Image
|
3 |
import os
|
4 |
import pandas as pd
|
5 |
+
import tomli
|
6 |
|
7 |
+
pd.options.mode.chained_assignment = None
|
8 |
|
9 |
+
st.set_page_config(layout="wide")
|
10 |
+
|
11 |
+
|
12 |
+
@st.cache_data
|
13 |
def load_data():
|
14 |
df_ind = pd.read_csv("data/df_individuals_score.csv", index_col=[0])
|
15 |
df_ind = df_ind.drop("region_code", axis=1)
|
|
|
19 |
].astype(str)
|
20 |
|
21 |
df_ind = df_ind[df_ind["productive_year"] <= 1800]
|
|
|
22 |
return df_ind
|
23 |
|
24 |
|
25 |
df_ind = load_data()
|
26 |
|
27 |
+
|
28 |
+
def load_region_descriptions():
|
29 |
+
with open("regions.toml", "rb") as toml_file:
|
30 |
+
data = tomli.load(toml_file)
|
31 |
+
return data
|
32 |
+
|
33 |
+
|
34 |
+
# Function to get description based on selected region
|
35 |
+
def get_region_description(region_data, selected_region):
|
36 |
+
return region_data[selected_region]["description"]
|
37 |
+
|
38 |
+
|
39 |
+
region_data = load_region_descriptions()
|
40 |
+
|
41 |
+
|
42 |
+
st.sidebar.title("Our History in Data")
|
43 |
+
st.sidebar.write(
|
44 |
+
"This project is led by Charles de Dampierre, Folgert Karsdorp, Mike Kestemont, Valentin Thouzeau and Nicolas Baumard"
|
45 |
+
)
|
46 |
|
47 |
# Set the global index path
|
48 |
global_index_path = "data/immaterial_index/figures_trends_R/results"
|
|
|
63 |
|
64 |
from region_list import region_list
|
65 |
|
66 |
+
region_filtered = list(region_list.keys())
|
67 |
+
|
68 |
index_paths = {}
|
69 |
|
70 |
for region_key in region_list:
|
|
|
86 |
|
87 |
# Display the selected region's images vertically
|
88 |
if selected_region in index_paths:
|
89 |
+
col1, col2 = st.columns(2)
|
90 |
|
91 |
df = df_ind[df_ind["region_name"] == selected_region]
|
|
|
92 |
df = df.drop(["region_name", "decade"], axis=1)
|
93 |
df = df[
|
94 |
[
|
|
|
100 |
]
|
101 |
df = df.sort_values("score", ascending=False)
|
102 |
df = df.rename(columns={"score": "Number of Catalogs"})
|
|
|
|
|
103 |
|
104 |
+
min_date = region_list[selected_region]["time_range"][0]
|
105 |
+
max_date = region_list[selected_region]["time_range"][1]
|
106 |
+
df = df[df["productive_year"] >= min_date]
|
107 |
+
df = df[df["productive_year"] <= max_date]
|
108 |
+
df["productive_year"] = df["productive_year"].astype(int)
|
109 |
+
df = df.reset_index(drop=True)
|
110 |
|
111 |
+
# Display the data in the left column
|
112 |
+
with col1:
|
113 |
+
st.header("Cultural Producers")
|
114 |
+
st.dataframe(df)
|
115 |
+
st.write(f"Number of Cultural producers active before 1800: {len(df)}")
|
116 |
+
|
117 |
+
for key, path in index_paths[selected_region].items():
|
118 |
+
if os.path.exists(path):
|
119 |
+
|
120 |
+
if key == "global_index":
|
121 |
+
st.subheader("Global Index")
|
122 |
+
st.image(
|
123 |
+
Image.open(path),
|
124 |
+
caption=key.capitalize(),
|
125 |
+
use_column_width=True,
|
126 |
+
)
|
127 |
+
elif key == "global_index_per_capita":
|
128 |
+
st.subheader("Index per capita")
|
129 |
+
st.image(
|
130 |
+
Image.open(path),
|
131 |
+
caption=key.capitalize(),
|
132 |
+
use_column_width=True,
|
133 |
+
)
|
134 |
+
elif key == "unseen_index":
|
135 |
+
st.subheader("Unsee-Species Index")
|
136 |
+
st.image(
|
137 |
+
Image.open(path),
|
138 |
+
caption=key.capitalize(),
|
139 |
+
use_column_width=True,
|
140 |
+
)
|
141 |
+
elif key == "unseen_index_capita":
|
142 |
+
st.subheader("Unsee-Species per capita Index")
|
143 |
+
st.image(
|
144 |
+
Image.open(path),
|
145 |
+
caption=key.capitalize(),
|
146 |
+
use_column_width=True,
|
147 |
+
)
|
148 |
+
elif key == "population_index":
|
149 |
+
st.subheader("Population Index")
|
150 |
+
st.image(
|
151 |
+
Image.open(path),
|
152 |
+
caption=key.capitalize(),
|
153 |
+
use_column_width=True,
|
154 |
+
)
|
155 |
+
elif key == "map":
|
156 |
+
st.subheader("Maps")
|
157 |
+
st.sidebar.image(
|
158 |
+
Image.open(path),
|
159 |
+
caption=key.capitalize(),
|
160 |
+
use_column_width=True,
|
161 |
+
)
|
162 |
+
else:
|
163 |
+
st.write(f"File for {key.capitalize()} does not exist.")
|
164 |
+
|
165 |
+
with col2:
|
166 |
+
try:
|
167 |
+
region_description = get_region_description(
|
168 |
+
region_data, selected_region
|
169 |
)
|
170 |
+
st.header("Analysis")
|
171 |
+
st.write(f"{region_description}")
|
172 |
+
except:
|
173 |
+
st.write("Analysis not ready yet")
|
data/immaterial_index/figures_trends_R/results/Chinese world.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/Greek World.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/Indian world.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/Latin World.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/Low countries.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/Nordic countries.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/Slav world.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/United Kingdom.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/Western Europe.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/ancient_med.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/byzance.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/china_north_south.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/europe_north_south.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/france.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/india_north_south.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/italy.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/japan.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/japan_north_south.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/mena.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/mena_persian_arab.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/spain.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results/yangtze.png
CHANGED
Git LFS Details
|
Git LFS Details
|
data/immaterial_index/figures_trends_R/results_per_capita/Italy.png
ADDED
Git LFS Details
|
data/immaterial_index/figures_trends_R/results_per_capita/Japan.png
ADDED
Git LFS Details
|
project.toml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
|
region_list.py
CHANGED
@@ -1,38 +1,37 @@
|
|
1 |
-
region_list =
|
2 |
-
"Arabic world",
|
3 |
-
"
|
4 |
-
"
|
5 |
-
"
|
6 |
-
"British Islands",
|
7 |
-
"Arabian peninsula",
|
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 |
-
|
35 |
-
]
|
36 |
|
37 |
|
38 |
full_region_list = [
|
|
|
1 |
+
region_list = {
|
2 |
+
"Arabic world": {"time_range": [600, 1800]},
|
3 |
+
"Italy": {"time_range": [600, 1800]},
|
4 |
+
"Japan": {"time_range": [600, 1800]},
|
5 |
+
"Mediterranean World": {"time_range": [-800, 500]},
|
6 |
+
"British Islands": {"time_range": [600, 1800]},
|
7 |
+
"Arabian peninsula": {"time_range": [600, 1800]},
|
8 |
+
"South East Asia": {"time_range": [-500, 1800]},
|
9 |
+
"Muslim world": {"time_range": [600, 1800]},
|
10 |
+
"Greek World": {"time_range": [-800, 500]},
|
11 |
+
"Central Europe": {"time_range": [600, 1800]},
|
12 |
+
"Ottoman Turkey": {"time_range": [800, 1800]},
|
13 |
+
"Chinese world": {"time_range": [-800, 1800]},
|
14 |
+
"German world": {"time_range": [600, 1800]},
|
15 |
+
"Korea": {"time_range": [600, 1800]},
|
16 |
+
"Spain": {"time_range": [600, 1800]},
|
17 |
+
"Greece": {"time_range": [600, 1800]},
|
18 |
+
"Balkans": {"time_range": [600, 1800]},
|
19 |
+
"Low countries": {"time_range": [600, 1800]},
|
20 |
+
"Norway": {"time_range": [600, 1800]},
|
21 |
+
"Portugal": {"time_range": [600, 1800]},
|
22 |
+
"Ottoman world": {"time_range": [1500, 1800]},
|
23 |
+
"Yangtze": {"time_range": [-800, 1800]},
|
24 |
+
"Sweden": {"time_range": [600, 1800]},
|
25 |
+
"France": {"time_range": [600, 1800]},
|
26 |
+
"Slav world": {"time_range": [600, 1800]},
|
27 |
+
"Nordic countries": {"time_range": [600, 1800]},
|
28 |
+
"Indian world": {"time_range": [-800, 1800]},
|
29 |
+
"Latin World": {"time_range": [-800, 500]},
|
30 |
+
"United Kingdom": {"time_range": [600, 1800]},
|
31 |
+
"Persian world": {"time_range": [-800, 1800]},
|
32 |
+
"Eastern Europe": {"time_range": [600, 1800]},
|
33 |
+
"Western Europe": {"time_range": [600, 1800]},
|
34 |
+
}
|
|
|
35 |
|
36 |
|
37 |
full_region_list = [
|
regions.toml
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
[Japan]
|
3 |
+
name = "Japan"
|
4 |
+
description = """
|
5 |
+
|
6 |
+
Our results converge with qualitative and quantitative assessments of economic development Bassino et al.
|
7 |
+
(2019); Farris (2009); Nakabayashi et al. (2020) (see Fig. 10).
|
8 |
+
|
9 |
+
We observe a rise of cultural production from the 7th c. (Nara era) to the 10th c. (Heian era) during which it is estimated that GDP per capita
|
10 |
+
increased by 80% Bassino et al. (2019); Nakabayashi et al. (2020). We also observe a continuous rise of
|
11 |
+
cultural production from the 16th c. onward during which it is estimated that population tripled (from 10
|
12 |
+
to 32 million people), GDP per capita increased by 80%, urbanization was multiplied by 5 from 2.5% to
|
13 |
+
12,5%, with the size of Tokyo and Osaka rivaling that of London or Paris Bassino et al. (2019); Nakabayashi
|
14 |
+
et al. (2020). Whereas the previous estimates of the GDP per capita showed extended stagnancy between
|
15 |
+
the ninth and 14th c., our results converge with the most recent study, showing a sharp decline in the 12th
|
16 |
+
century and recovery from the 13th to 16th centuries Nakabayashi et al. (2020).
|
17 |
+
|
18 |
+
In line with this study Nakabayashi et al. (2020), our results also suggest that the recovery of the economic development began in
|
19 |
+
the 13th during the Kamakura shogunate, earlier than what was previously estimated.
|
20 |
+
Our result also allows to have finer temporal estimation. For instance, we observe that the isolation of
|
21 |
+
the country (the sakoku policy) starting in 1633 did not impact economic cultural production. At the other
|
22 |
+
end of the period, we can see that cultural production was already very robust before the Meiji reforms
|
23 |
+
(1868).
|
24 |
+
|
25 |
+
Also, we document the relative importance of the Kanta and Kansai plains in Japanese history, and
|
26 |
+
the progressive shift from the East to the West (see Fig. 11). Despite the political domination of the Kansai
|
27 |
+
plain from the 13th onward, the shift in cultural production only occurred during the late 18th c. (Edo
|
28 |
+
period)
|
29 |
+
|
30 |
+
|
31 |
+
"""
|
32 |
+
time_range = [800, 1800]
|