Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,7 @@ if not df.empty:
|
|
47 |
min_year = int(df["year1"].min())
|
48 |
max_year = int(df["year1"].max())
|
49 |
|
50 |
-
# Если есть хотя бы два разных года, отображаем слайдер
|
51 |
if min_year < max_year:
|
52 |
selected_year_range = st.sidebar.slider(
|
53 |
"Выберите диапазон лет выпуска",
|
@@ -75,7 +75,7 @@ if st.button("Выбрать случайно") and len(df) > 0:
|
|
75 |
|
76 |
with col2:
|
77 |
|
78 |
-
#
|
79 |
title = df.loc[df.index == i, "title"].iloc[0]
|
80 |
country = df.loc[df.index == i, "country"].iloc[0]
|
81 |
year = df.loc[df.index == i, "year1"].iloc[0]
|
@@ -83,7 +83,7 @@ if st.button("Выбрать случайно") and len(df) > 0:
|
|
83 |
cast = df.loc[df.index == i, "cast1"].iloc[0]
|
84 |
description = df.loc[df.index == i, "description"].iloc[0]
|
85 |
|
86 |
-
|
87 |
st.markdown(
|
88 |
f"<span style='font-weight:bold; font-size:22px;'>Название сериала:</span> <span style='font-size:20px;'>«{title}»</span>",
|
89 |
unsafe_allow_html=True,
|
|
|
47 |
min_year = int(df["year1"].min())
|
48 |
max_year = int(df["year1"].max())
|
49 |
|
50 |
+
# Если есть хотя бы два разных года, отображаем слайдер в боковой панели
|
51 |
if min_year < max_year:
|
52 |
selected_year_range = st.sidebar.slider(
|
53 |
"Выберите диапазон лет выпуска",
|
|
|
75 |
|
76 |
with col2:
|
77 |
|
78 |
+
# Используем loc для безопасного доступа к элементам DataFrame
|
79 |
title = df.loc[df.index == i, "title"].iloc[0]
|
80 |
country = df.loc[df.index == i, "country"].iloc[0]
|
81 |
year = df.loc[df.index == i, "year1"].iloc[0]
|
|
|
83 |
cast = df.loc[df.index == i, "cast1"].iloc[0]
|
84 |
description = df.loc[df.index == i, "description"].iloc[0]
|
85 |
|
86 |
+
|
87 |
st.markdown(
|
88 |
f"<span style='font-weight:bold; font-size:22px;'>Название сериала:</span> <span style='font-size:20px;'>«{title}»</span>",
|
89 |
unsafe_allow_html=True,
|