Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2@file 

3@brief Data mostly for the first year. 

4""" 

5from .data_helper import any_local_file 

6 

7 

8def anyfile(name, local=True, cache_folder=".", filename=True): 

9 """ 

10 Returns any file in sub folder `data_2a 

11 <https://github.com/sdpython/ensae_teaching_cs/tree/master/src/ensae_teaching_cs/data/data_2a>`_. 

12 

13 @param name file to download 

14 @param local local data or web 

15 @param cache_folder where to cache the data if downloaded a second time 

16 @param filename return the filename (True) or the content (False) 

17 @return text content (str) 

18 """ 

19 return any_local_file(name, "data_2a", cache_folder=cache_folder, filename=filename) 

20 

21 

22def wines_quality(local=True, cache_folder=".", filename=True): 

23 """ 

24 Datasets about wines quality. 

25 Source : `Wine Quality Data Set 

26 <https://archive.ics.uci.edu/ml/datasets/Wine+Quality>`_. 

27 

28 @param local local data or web 

29 @param cache_folder where to cache the data if downloaded a second time 

30 @param filename return the filename (True) or the content (False) 

31 @return text content (str) 

32 """ 

33 return anyfile("wines-quality.csv", local=local, cache_folder=cache_folder, filename=filename)