<jupyter_start><jupyter_text>Creating a timeseries_search() object> In order to search through Singstat time series datasets for datasets related to property and prices, I will instantiate a timeseries_search() object with the relevant keyphrases.<jupyter_code>data = st.timeseries_search(keyphrases=['house','price'],match_all=True)<jupyter_output><empty_output><jupyter_text>> Note that if there are no datasets which match the arguments input in the instantiation of the timeseries_search object, an error will be raised as follows:<jupyter_code>no_data = st.timeseries_search(keyphrases=['house','food'],match_all=True)<jupyter_output><empty_output><jupyter_text>Accessing information about datasets through timeseries_search() object's attributes<jupyter_code>data.resource_ids<jupyter_output><empty_output><jupyter_text>>The overview attriute of timeseries_search() presents metadata of the returned timeseries datasets in a pandas DataFrame<jupyter_code>data.overview<jupyter_output><empty_output><jupyter_text>>The full timeseries data is stored in a dictionary under the timeseries attriute of timeseries_search(). The timeseries attribute can thus be indexed by the resourceId of the dataset of interest. The data is then returned in a pandas DataFrame.<jupyter_code>data.timeseries[17092]<jupyter_output><empty_output><jupyter_text>>The returned datasets can be filtered by frequency of the timeseries and/or the start year. To demonstrate this, we filter the returned datasets based on frequency, filtering for datasets with 'annual' frequency. Note that the in_place argument is set to True, thus modifying the original timeseries_search() object.<jupyter_code>data.filter_datasets('annual', inplace=True)
data.resource_ids<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07078142695356739, 'fraction_numerical': 0.0028312570781426952, 'mean_word_length': 8.655737704918034, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '203734', 'license': 'MIT', 'n_tokens_mistral': 501, 'n_tokens_neox': 486, 'n_words': 166, 'path': 'singstatdata/vignette.ipynb', 'repo_name': 'dkow72/singstatdata', 'size': '1766'}