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# -*- coding: utf-8 -*- 

2""" 

3@file 

4@brief Jeux de données reliés aux vins. 

5""" 

6import os 

7import pandas 

8from pyquickhelper.filehelper import unzip_files 

9from .data_helper import get_data_folder 

10 

11 

12def load_tweet_dataset(cache="."): 

13 """ 

14 Retourne quelques tweets extrait en 2016. 

15 Les données sont disponibles dans le répertoire 

16 `data <https://github.com/sdpython/papierstat/tree/master/src/papierstat/datasets/data>`_. 

17 Notebooks associés à ce jeu de données : 

18 

19 .. runpython:: 

20 :rst: 

21 

22 from papierstat.datasets.documentation import list_notebooks_rst_links 

23 links = list_notebooks_rst_links('lectures', 'artificiel_tokenize_features') 

24 links = [' * %s' % s for s in links] 

25 print('\\n'.join(links)) 

26 

27 @param cache where to cache or unzip the data if downloaded a second time 

28 @return text content (str) 

29 """ 

30 data = get_data_folder() 

31 name = os.path.join(data, 'tweets_macron_sijetaispresident_201609.zip') 

32 one = unzip_files(name, where_to=cache) 

33 return pandas.read_csv(one[0], encoding='utf-8', sep='\t')