<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. 
june_temps = session.query(Measurement).filter(extract('month', Measurement.date) == 6)
#  3. Convert the June temperatures to a list.
june_temps_list = [temp.tobs for temp in june_temps]
print(june_temps_list)
# 4. Create a DataFrame from the list of temperatures for the month of June. 
june_df = pd.DataFrame(june_temps_list, columns=["temps"])
june_df
# 5. Calculate and print out the summary statistics for the June temperature DataFrame.
june_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.
december_temps = session.query(Measurement).filter(extract('month', Measurement.date) == 12)
# 7. Convert the December temperatures to a list.
december_temps_list = [temp.tobs for temp in december_temps]
print(december_temps_list)
# 8. Create a DataFrame from the list of temperatures for the month of December. 
december_df = pd.DataFrame(december_temps_list, columns=["temps"])
december_df
# 9. Calculate and print out the summary statistics for the Decemeber temperature DataFrame.
december_df.describe()<jupyter_output><empty_output><jupyter_text>D3: Additional Queries<jupyter_code># 1.1 Write a query that filters the Measurement table to retrieve the precipatation for the month of June.
june_prcp = session.query(Measurement.date, Measurement.prcp).filter(extract('month', Measurement.date) == 6)
# 1.2 Convert the June precipatation to a list.
june_prcp_list = [prcp.prcp for prcp in june_prcp]
print(june_prcp_list)
# 1.3 Create a DataFrame from the list of precipitation for the month of June. 
june_prcp_df = pd.DataFrame(june_prcp_list, columns=["precipitation"])
june_prcp_df
# 1.4 Calculate and print out the summary statistics for the June precipitation DataFrame.
june_prcp_df.describe()
# 2.1 Write a query that filters the Measurement table to retrieve the precipatation for the month of December.
december_prcp = session.query(Measurement.date, Measurement.prcp).filter(extract('month', Measurement.date) == 12)
# 2.2 Convert the December precipatation to a list.
december_prcp_list = [prcp.prcp for prcp in december_prcp]
print(december_prcp_list)
# 2.3 Create a DataFrame from the list of precipitation for the month of December. 
december_prcp_df = pd.DataFrame(december_prcp_list, columns=["precipitation"])
december_prcp_df
# 2.4 Calculate and print out the summary statistics for the June precipitation DataFrame.
december_prcp_df.describe()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07794943820224719, 'fraction_numerical': 0.011938202247191011, 'mean_word_length': 6.087064676616915, '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': '474092', 'license': 'MIT', 'n_tokens_mistral': 930, 'n_tokens_neox': 869, 'n_words': 303, 'path': 'SurfsUp_Challenge.ipynb', 'repo_name': 'weihaolun/surfs_up', 'size': '2848'}