<jupyter_start><jupyter_text>Real Estate Crime This notebook exposes crime around Sacramento, via a set of CSV files with a bit of pandas magic to create a combined data source for Tableau.<jupyter_code>import pandas as pd

import jupytab
crime_df = pd.read_csv('sacramento_crime.csv')
real_estate_df = pd.read_csv('sacramento_realestate.csv')
combined_df = crime_df.append(real_estate_df)<jupyter_output><empty_output><jupyter_text>Table definitionThis cell will create a Table repository that will allow to expose data through jupyter kernel gateway<jupyter_code>tables = jupytab.Tables()
tables['crime'] = jupytab.DataFrameTable('Crime Statistics sample in Sacramento', crime_df)
tables['real_estate'] = jupytab.DataFrameTable('Real Estate transaction sample in Sacramento', real_estate_df)
tables['combined'] = jupytab.DataFrameTable('Combination of data sources', combined_df)<jupyter_output><empty_output><jupyter_text>Schema renderingThis cell serves schema in json format. The following content is expected when running in a Jupyter notebook`[{"id": "crime", "alias": "Crime Statistics sample in Sacramento", "columns": [{"id": "cdatetime", "dataType": "string"}, {"id": "address", "dataType": "string"}, {"id": "district", "dataType": "int"}, {"id": "beat", "dataType": "string"}, {"id": "grid", "dataType": "int"}, {"id": "crimedescr", "dataType": "string"}, {"id": "ucr_ncic_code", "dataType": "int"}, {"id": "latitude", "dataType": "float"}, {"id": "longitude", "dataType": "float"}]},...]`The ` GET /schema` **MUST** be provided as the first line of the cell<jupyter_code># GET /schema
tables.render_schema()<jupyter_output><empty_output><jupyter_text>Data renderingThis cell serves dataframe in json format.The following error is expected when running this cell in a jupyter environment as Jupyter Kernel Gateway will provide the REQUEST object.` -------------------------------------------------------------------------- NameError                                 Traceback (most recent call last)  in ()       1  GET /data ----> 2  tables.render_data(REQUEST) NameError: name 'REQUEST' is not defined`The ` GET /data` **MUST** be provided as the first line of the cell<jupyter_code># GET /data
tables.render_data(REQUEST)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15975286849073256, 'fraction_numerical': 0.00088261253309797, 'mean_word_length': 5.07774798927614, 'pattern_counts': {'":': 21, '<': 17, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '389470', 'license': 'MIT', 'n_tokens_mistral': 691, 'n_tokens_neox': 661, 'n_words': 217, 'path': 'jupytab-server/samples/real-estate_crime/RealEstateCrime.ipynb', 'repo_name': 'CFMTech/Jupytab', 'size': '2266'}