Spaces:
Sleeping
Sleeping
Maximilian Noichl
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,8 +23,32 @@ from opinionated.core import download_googlefont
|
|
| 23 |
download_googlefont('Quicksand', add_to_cache=True)
|
| 24 |
plt.rc('font', family='Quicksand')
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
hdbscan_example_data = np.load('clusterable_data.npy')
|
| 30 |
penguins_dataset = pd.read_csv('penguins.csv')[['bill_length_mm','bill_depth_mm','flipper_length_mm']].dropna().values
|
|
|
|
| 23 |
download_googlefont('Quicksand', add_to_cache=True)
|
| 24 |
plt.rc('font', family='Quicksand')
|
| 25 |
|
| 26 |
+
#wget https://github.com/scikit-learn-contrib/hdbscan/raw/master/notebooks/clusterable_data.npy
|
| 27 |
+
#!wget https://github.com/mwaskom/seaborn-data/raw/master/penguins.csv
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
import requests
|
| 31 |
+
|
| 32 |
+
# URLs of the files to download
|
| 33 |
+
clusterable_data_url = "https://github.com/scikit-learn-contrib/hdbscan/raw/master/notebooks/clusterable_data.npy"
|
| 34 |
+
penguins_csv_url = "https://github.com/mwaskom/seaborn-data/raw/master/penguins.csv"
|
| 35 |
+
|
| 36 |
+
# Function to download and save a file from a URL
|
| 37 |
+
def download_file(url, local_filename):
|
| 38 |
+
with requests.get(url, stream=True) as r:
|
| 39 |
+
r.raise_for_status()
|
| 40 |
+
with open(local_filename, 'wb') as f:
|
| 41 |
+
for chunk in r.iter_content(chunk_size=8192):
|
| 42 |
+
f.write(chunk)
|
| 43 |
+
|
| 44 |
+
# Download the files
|
| 45 |
+
download_file(clusterable_data_url, "clusterable_data.npy")
|
| 46 |
+
download_file(penguins_csv_url, "penguins.csv")
|
| 47 |
+
|
| 48 |
+
print("Files downloaded successfully.")
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
|
| 52 |
|
| 53 |
hdbscan_example_data = np.load('clusterable_data.npy')
|
| 54 |
penguins_dataset = pd.read_csv('penguins.csv')[['bill_length_mm','bill_depth_mm','flipper_length_mm']].dropna().values
|