Skip to content

Instantly share code, notes, and snippets.

@dan-r95
Created June 25, 2020 13:22
Show Gist options
  • Save dan-r95/234edf8d65b4fcaaea1b80264b1d943d to your computer and use it in GitHub Desktop.
Save dan-r95/234edf8d65b4fcaaea1b80264b1d943d to your computer and use it in GitHub Desktop.
download Case Western Reserve University Bearing Data to folder (google colab)
import pandas as pd
""" downloads the dataset, so that all matlab files of each class are in their own folder
the package cwru is sadly only for python2
12DriveEndFault / 172.mat
/ 189.mat
...
12FanEndFault / 89.mat
...
https://csegroups.case.edu/bearingdatacenter/pages/download-data-file
"""
!wget https://raw.githubusercontent.com/Litchiware/cwru/master/cwru/metadata.txt
col = ["class", "x", "y", "url"]
data = pd.read_csv("metadata.txt", delimiter= " ", names = col)
data.head()
for row in data.itertuples():
url = row[4]
cls = row[1] # class name, e.g 12DriveEndFault
!wget $url -P CWRU/$cls #-q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment