Update app.py
Browse files
app.py
CHANGED
|
@@ -1,24 +1,12 @@
|
|
| 1 |
import requests
|
| 2 |
-
import
|
| 3 |
from io import BytesIO
|
| 4 |
|
| 5 |
url = "https://huggingface.co/buckets/Neon-tech/Dataset-arranger/resolve/image-shards/shard_000021.parquet?download=true"
|
| 6 |
|
| 7 |
-
# Download file
|
| 8 |
response = requests.get(url)
|
| 9 |
response.raise_for_status()
|
| 10 |
|
| 11 |
-
|
| 12 |
-
df = pd.read_parquet(BytesIO(response.content))
|
| 13 |
|
| 14 |
-
|
| 15 |
-
print("Shape:", df.shape)
|
| 16 |
-
print("\nColumns:", df.columns)
|
| 17 |
-
|
| 18 |
-
# Print first rows
|
| 19 |
-
print("\nFirst 10 rows:")
|
| 20 |
-
print(df.head(10))
|
| 21 |
-
|
| 22 |
-
# If you REALLY want to list all rows (be careful)
|
| 23 |
-
# for i, row in df.iterrows():
|
| 24 |
-
# print(i, row.to_dict())
|
|
|
|
| 1 |
import requests
|
| 2 |
+
import pyarrow.parquet as pq
|
| 3 |
from io import BytesIO
|
| 4 |
|
| 5 |
url = "https://huggingface.co/buckets/Neon-tech/Dataset-arranger/resolve/image-shards/shard_000021.parquet?download=true"
|
| 6 |
|
|
|
|
| 7 |
response = requests.get(url)
|
| 8 |
response.raise_for_status()
|
| 9 |
|
| 10 |
+
table = pq.read_table(BytesIO(response.content))
|
|
|
|
| 11 |
|
| 12 |
+
print("Number of rows:", table.num_rows)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|