In [10]:
import os
import requests
WALKING_DATASET = (
"https://archive.ics.uci.edu/ml/machine-learning-databases/00286/User%20Identification%20From%20Walking%20Activity.zip",
)
def download_data(path='data', urls=WALKING_DATASET):
if not os.path.exists(path):
os.mkdir(path)
for url in urls:
response = requests.get(url)
name = os.path.basename(url)
with open(os.path.join(path, name), 'wb') as f:
f.write(response.content)
download_data()
In [11]:
import zipfile
z = zipfile.ZipFile(os.path.join('data', 'User%20Identification%20From%20Walking%20Activity.zip'))
z.extractall(os.path.join('data', 'walking'))
In [ ]:
import pandas as pd
df = pd.
for root, dirs, files in os.walk(os.path.join('data', 'walking','User Identification From Walking Activity')):
for file in files:
if file.endswith(".csv"):
print(int(os.path.splitext(file)[0]))
In [22]:
In [ ]: