<jupyter_start><jupyter_text>Example of interactive use<jupyter_code>import pandas as pd
import numpy as np

from ramprate.build_features import process_subset
from ramprate.load_dataset import load_epa_crosswalk, load_epacems
from ramprate.visualize import plot_component_max_ramp
pd.options.display.max_rows = 50
states = ['FL'] # for all states, set to None
years = [2016] # for all years, set to None
# the default value for columns picks an appropriate subset.
# columns = <subset> # for all columns, set to None
cems = load_epacems(states=states, years=years) # , columns=columns)
cems.set_index(
            ["unit_id_epa", "operating_datetime_utc"],
            drop=False,
            inplace=True,
        )
cems.sort_index(inplace=True)
crosswalk = load_epa_crosswalk()
outputs = process_subset(cems, crosswalk)<jupyter_output><empty_output><jupyter_text>Visualize an individual component<jupyter_code>component_id=1
plot_component_max_ramp(component_id=component_id, window_hours=8760, cdf=False, **outputs)<jupyter_output><empty_output><jupyter_text>Same as above but zoomed in (small window size)<jupyter_code>plot_component_max_ramp(component_id=component_id, window_hours=10*24, cdf=False, **outputs)<jupyter_output><empty_output><jupyter_text>Show each output<jupyter_code>item = iter(outputs.items())
k, v = next(item)
print(f"{k} has shape {v.shape}")
v.sample(3)
k, v = next(item)
print(f"{k} has shape {v.shape}")
v.sample(3)
k, v = next(item)
print(f"{k} has shape {v.shape}")
v.sample(3)
k, v = next(item)
print(f"{k} has shape {v.shape}")
v.sample(3)<jupyter_output>cems has shape (2573664, 11)
{'fraction_non_alphanumeric': 0.11928306551297899, 'fraction_numerical': 0.0173053152039555, 'mean_word_length': 6.565420560747664, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '272207', 'license': 'MIT', 'n_tokens_mistral': 607, 'n_tokens_neox': 584, 'n_words': 131, 'path': 'notebooks/8.0-tb-example_of_interactive_use.ipynb', 'repo_name': 'catalyst-cooperative/epacems_ramp_rates', 'size': '1618'}