Spaces:
Build error
Build error
Upload 2 files
Browse files
Utility/__pycache__/data_loader.cpython-312.pyc
ADDED
|
Binary file (1.64 kB). View file
|
|
|
Utility/data_loader.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import pyarrow.dataset as ds
|
| 4 |
+
|
| 5 |
+
# Load and cache data
|
| 6 |
+
@st.cache_data
|
| 7 |
+
def load_data(n_rows=1_000_000):
|
| 8 |
+
dataset = ds.dataset("train_series.parquet", format="parquet")
|
| 9 |
+
table = dataset.scanner().head(n_rows)
|
| 10 |
+
return table.to_pandas()
|
| 11 |
+
|
| 12 |
+
@st.cache_data
|
| 13 |
+
def load_train_series():
|
| 14 |
+
return load_data()
|
| 15 |
+
|
| 16 |
+
@st.cache_data
|
| 17 |
+
def load_train_events():
|
| 18 |
+
return pd.read_csv("train_events.csv")
|
| 19 |
+
|
| 20 |
+
@st.cache_data
|
| 21 |
+
def load_sample_submission():
|
| 22 |
+
return pd.read_csv("sample_submission.csv")
|
| 23 |
+
|
| 24 |
+
@st.cache_data
|
| 25 |
+
def load_test_series():
|
| 26 |
+
return pd.read_parquet("test_series.parquet")
|