I want to download a dataset from the UCI repository.
The dataset is in the tar.Z
format, and ideally I'd like to read it in as a pandas
data frame.
I've checked out uncompressing tar.Z file with python? which suggested the zgip
library, so from https://docs.python.org/3/library/gzip.html I tried using the below code but I got an error message.
Thanks for any help!
import gzip
with gzip.open('https://archive.ics.uci.edu/ml/machine-learning-databases/diabetes/diabetes-data.tar.Z', 'rb') as f:
file_content = f.read()
ERROR MESSAGE:
OSError: [Errno 22] Invalid argument: 'https://archive.ics.uci.edu/ml/machine-learning-databases/diabetes/diabetes-data.tar.Z'