<jupyter_start><jupyter_text>Bonus: Temperature Analysis I<jupyter_code>import pandas as pd
from datetime import datetime as dt
# "tobs" is "temperature observations"
df = pd.read_csv('Resources/hawaii_measurements.csv')
df.head()
# Convert the date column format from string to datetime
df.date = pd.to_datetime(df.date, infer_datetime_format=True)
# Set the date column as the DataFrame index
df = df.set_index(df['date'])
# Drop the date column
df = df.drop(columns='date')
df.head()<jupyter_output><empty_output><jupyter_text>Compare June and December data across all years<jupyter_code>from scipy import stats
# Filter data for desired months
jun_data = df[df.index.month == 6]
dec_data = df[df.index.month == 12]
# Identify the average temperature for June
jun_data.mean()
# Identify the average temperature for December
dec_data.mean()
# Create collections of temperature data
jun_temp = jun_data.tobs
dec_temp = dec_data.tobs
# Run paired t-test
stats.ttest_ind(jun_temp, dec_temp)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09617271835132483, 'fraction_numerical': 0.002944062806673209, 'mean_word_length': 6.445255474452555, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '114432', 'license': 'ADSL', 'n_tokens_mistral': 344, 'n_tokens_neox': 329, 'n_words': 98, 'path': 'temp_analysis_bonus_1_starter.ipynb', 'repo_name': 'donald1988/10-Advanced-Data-Storage-and-Retrieval', 'size': '1019'}