<jupyter_start><jupyter_text>IntroductionI spent sometime researching some interesting datasets for the exploration of timseries modelling and analysis. In this notebook, I will walk you through these datasets.<jupyter_code>%load_ext autoreload
%autoreload 2
import pandas as pd

from ts import data
from ts.viz import *<jupyter_output><empty_output><jupyter_text>Global Temperatures Dataset**Source**: [Github](https://github.com/datasets/global-temp)**Description**: Global Temperature Time Series (monthly and annual)**Ideas**: Simple dataste, useful to show seanoality (Annual temp fluctuations) vs trend (Global Warming).<jupyter_code>df = data.load_globaltemp(frmt='pandas', mode='monthly')
df.head()<jupyter_output><empty_output><jupyter_text>Trump Tweets**Source**: [Kaggle](https://www.kaggle.com/austinreese/trump-tweets)**Description**: Tweets by <NAME> from May 2009 to June 2020**Ideas**: Could be useful to explore any cyclical patterns (maybe using DFT), or simply visualize to see how the tweeting frequency changed overtime. My hypothesis that this is non-stationary timeseries, as the tweeting pattern of Donald Trump were likely different before and after the election.<jupyter_code>df = data.load_trumptweets()
print(df.date.min(), df.date.max())
df.info()<jupyter_output>2009-05-04 13:54:25 2020-06-17 21:28:52
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 43352 entries, 0 to 43351
Data columns (total 8 columns):
 #   Column     Non-Null Count  Dtype 
---  ------     --------------  ----- 
 0   id         43352 non-null  int64 
 1   link       43352 non-null  object
 2   content    43352 non-null  object
 3   date       43352 non-null  object
 4   retweets   43352 non-null  int64 
 5   favorites  43352 non-null  int64 
 6   mentions   20386 non-null  object
 7   hashtags   5583 non-null   object
dtypes: int64(3), object(5)
memory usage: 2.6+ MB<jupyter_text>MotionSense Dataset: Sensor Based Human Activity and Attribute Recognition**Source**: [Kaggle](https://www.kaggle.com/malekzadeh/motionsense-dataset)**Description**: This dataset includes time-series data generated by accelerometer and gyroscope sensors (attitude, gravity, userAcceleration, and rotationRate). It is collected with an iPhone 6s kept in the participant's front pocket using SensingKit which collects information from Core Motion framework on iOS devices. A total of 24 participants in a range of gender, age, weight, and height performed 6 activities in 15 trials in the same environment and conditions: downstairs, upstairs, walking, jogging, sitting, and standing. With this dataset, we aim to look for personal attributes fingerprints in time-series of sensor data, i.e. attribute-specific patterns that can be used to infer gender or personality of the data subjects in addition to their activities.**Ideas**: Could be useful to explore for experimenting with machine learning models<jupyter_code>help(data.load_motionsense)<jupyter_output>Help on function load_motionsense in module ts.data:

load_motionsense(frmt: str = 'pandas', activity_trial: str = None, subject: int = None, subjects_info: bool = False)
    Loads subsets of the Motionsense dataset. You can either load the subject information datset, which
    provides metadata about the subjects, or the data for a particular activity and subject pair.
    
    There are 24 subject and 6 different labels abbreviated as follows
    
    dws: downstairs
    ups: upstairs
    sit: sitting
    std: standing
    wlk: walking
    jog: jogging
    
    Arguments:
    - frmt: returned data structure (pandas or spark dataframes)
    - activity_trial: activity and trial number e.g. (ups_4)
    - subject: subject id (1 to 24)
    - subjects_info: Boolean, if true, it will load subjects metadata and ignore the device and subject arguments
    
    Return:
    - Path, Pandas dataframe or Spark dataframe<jupyter_text>Load data for a specific device and subject<jupyter_code>df = data.load_motionsense(activity_trial='wlk_7', subject=2, frmt='pandas')
df.head(2)<jupyter_output><empty_output><jupyter_text>Load meta data about subjects<jupyter_code>df = data.load_motionsense(subjects_info=True)
df.head(2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08368996671421779, 'fraction_numerical': 0.029719448407037566, 'mean_word_length': 4.63941018766756, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '552421', 'license': 'MIT', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1202, 'n_words': 456, 'path': 'notebooks/02_Processing/01_Interesting Time Series Datasets.ipynb', 'repo_name': 'mleila/timeseries', 'size': '4212'}