<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.dtypes
df['date'] = pd.to_datetime(df['date'])
# Set the date column as the DataFrame index
df = df.set_index('date')
df.columns
# Drop the date column<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
# df[df['date'].dt.month_name() == 'June']
df_jun = df.query('index.dt.month in [6]')
df_dec = df.query('index.dt.month in [12]')
df_all = df.query('index.dt.month in [12, 6]')
# Identify the average temperature for June
print(f"The average temperature for June is  {df_jun['tobs'].mean()}")
# Identify the average temperature for December
# df_dec['tobs'].mean()
print(f"The average temperature for December is  {df_dec['tobs'].mean()}")

# Create collections of temperature data
june = df_jun['tobs']
dec = df_dec['tobs']
june.describe()
dec.describe()
# Run paired t-test
res = stats.ttest_ind(june, dec, equal_var=True)
res<jupyter_output><empty_output><jupyter_text>Analysis<jupyter_code>df.query('index.dt.month in [6]').boxplot('tobs')

df.query('index.dt.month in [12]').boxplot('tobs')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14215686274509803, 'fraction_numerical': 0.0063025210084033615, 'mean_word_length': 6.641711229946524, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '613057', 'license': 'MIT', 'n_tokens_mistral': 509, 'n_tokens_neox': 494, 'n_words': 128, 'path': 'temp_analysis_bonus_1_starter.ipynb', 'repo_name': 'g8r1fl/sqlalchemy-challenge', 'size': '1428'}