File size: 595 Bytes
f9f24ec
 
 
 
89247af
 
f9f24ec
 
 
729e874
f9f24ec
 
 
 
 
89247af
f9f24ec
89247af
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import streamlit as st
import json
from datasets import load_dataset

st.set_page_config(page_title="Kaggle Notebooks (as scripts) visualization", layout="wide")
st.title("Kaggle Notebooks (as scripts) visualization")

@st.cache()
def load_data():
    ds = load_dataset("loubnabnl/kaggle-scripts-subset", split="train")
    return ds

samples = load_data()
col1, _ = st.columns([2, 4])
with col1:
    index_example = st.number_input(f"Index of the chosen sample from the existing {len(samples)}", min_value=0, max_value=len(samples)-1, value=0, step=1)

st.code(samples[index_example]["script"])