Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ import pandas as pd
|
|
12 |
#st.dataframe(df.head(3))
|
13 |
# from datasets import load_dataset
|
14 |
|
15 |
-
|
16 |
# st.write(type(dataset))
|
17 |
# st.write('Hello World')
|
18 |
|
@@ -20,7 +20,23 @@ import pandas as pd
|
|
20 |
#dataset = load_dataset("rwcuffney/autotrain-data-pick_a_card")
|
21 |
#st.write(dataset)
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
from datasets import load_dataset #this isn't working
|
24 |
dataset = load_dataset("rwcuffney/pick_a_card_test") #rwcuffney/pick_a_card_test
|
25 |
|
26 |
-
st.write(
|
|
|
12 |
#st.dataframe(df.head(3))
|
13 |
# from datasets import load_dataset
|
14 |
|
15 |
+
dataset = load_dataset("https://rwcuffney/autotrain-data-pick_a_card")
|
16 |
# st.write(type(dataset))
|
17 |
# st.write('Hello World')
|
18 |
|
|
|
20 |
#dataset = load_dataset("rwcuffney/autotrain-data-pick_a_card")
|
21 |
#st.write(dataset)
|
22 |
|
23 |
+
import pandas as pd
|
24 |
+
import requests
|
25 |
+
import io
|
26 |
+
|
27 |
+
# Downloading the csv file from your GitHub account
|
28 |
+
url = "https://huggingface.co/datasets/rwcuffney/autotrain-data-pick_a_card/raw/main/cards.csv" # Make sure the url is the raw version of the file on GitHub
|
29 |
+
download = requests.get(url).content
|
30 |
+
|
31 |
+
|
32 |
+
# Reading the downloaded content and turning it into a pandas dataframe
|
33 |
+
df = pd.read_csv(io.StringIO(download.decode('utf-8')))
|
34 |
+
#df = pd.read_csv('playing_cards/cards.csv').sort_values('class index')
|
35 |
+
df_test = df[df['data set']=='test']
|
36 |
+
df_train = df[df['data set']=='train']
|
37 |
+
df_validate = df[df['data set']=='validate']
|
38 |
+
|
39 |
from datasets import load_dataset #this isn't working
|
40 |
dataset = load_dataset("rwcuffney/pick_a_card_test") #rwcuffney/pick_a_card_test
|
41 |
|
42 |
+
st.write(df.head(20))
|