<jupyter_start><jupyter_text>D1: Determine the Summary Statistics for June<jupyter_code># 1. Import the sqlalchemy extract function.
from sqlalchemy import extract

# 2. Write a query that filters the Measurement table to retrieve the temperatures for the month of June. 
results=[]
results = session.query(Measurement.tobs).filter(extract('month', Measurement.date)==6).all()
#  3. Convert the June temperatures to a list.
temps_june = list(results)
temps_june
len(results)
# 4. Create a DataFrame from the list of temperatures for the month of June. 
temps_df = pd.DataFrame(results)
temps_df.columns = ['June Temps']
temps_df.head()
# 5. Calculate and print out the summary statistics for the June temperature DataFrame.
temps_df.describe()<jupyter_output><empty_output><jupyter_text>D2: Determine the Summary Statistics for December<jupyter_code># 6. Write a query that filters the Measurement table to retrieve the temperatures for the month of December.
results=[]
results = session.query(Measurement.tobs).filter(extract('month', Measurement.date)==12).all()
# 7. Convert the December temperatures to a list.
temps_dec = list(results)
temps_dec
# 8. Create a DataFrame from the list of temperatures for the month of December. 
dec_temps_df = pd.DataFrame(temps_dec)
dec_temps_df.columns = ['December Temps']
dec_temps_df.head()
# 9. Calculate and print out the summary statistics for the Decemeber temperature DataFrame.
dec_temps_df.describe()
columns = inspector.get_columns('station')
for column_name in columns:
    print (column_name["name"])
# Query for precipitation in June
results=[]
results = session.query(Measurement.prcp).filter(extract('month', Measurement.date)==6).all()
june_prcp = list(results)
june_prcp
# Convert to dataframe
june_prcp_df = pd.DataFrame(june_prcp)
june_prcp_df.columns = ["June Precipitation"]
june_prcp_df
# June rainfall statistics
june_prcp_df.describe()
# Query for precipitation in December
results=[]
results = session.query(Measurement.prcp).filter(extract('month', Measurement.date)==12).all()
dec_prcp = list(results)
dec_prcp
# Convert to dataframe
dec_prcp_df = pd.DataFrame(dec_prcp)
dec_prcp_df.columns = ["December Precipitation"]
dec_prcp_df
# December rainfall statistics
dec_prcp_df.describe()
fig, ax = plt.subplots(figsize=(10,6))
ax.set_ylabel("Temp(F)", fontsize = 14)
ax.set_xlabel("December", fontsize = 14)
ax.boxplot(dec_temps_df)
ax.set_yticks(np.arange(50,90, step=5.0))
plt.show()
fig, ax = plt.subplots(figsize=(10,6))
ax.set_ylabel("Temp(F)", fontsize = 14)
ax.set_xlabel("December", fontsize = 14)
ax.boxplot(temps_df)
ax.set_yticks(np.arange(50,90, step=5.0))
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11509715994020926, 'fraction_numerical': 0.016068759342301942, 'mean_word_length': 6.519662921348314, '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': '661010', 'license': 'MIT', 'n_tokens_mistral': 951, 'n_tokens_neox': 891, 'n_words': 242, 'path': 'SurfsUp_Challenge.ipynb', 'repo_name': 'Jhackmeyer/surfs_up', 'size': '2676'}