<jupyter_start><jupyter_text>Estimate a mean for the tree height dataUse the data in `data/trees.csv` to estimate the mean tree height. Save the mean to `results/mean-height.csv`.<jupyter_code>%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>Load the dataRead in the data as a pandas.DataFrame and show the first few rows.<jupyter_code>df = pd.read_csv('../../data/trees.csv')
df.columns = ['ID', 'girth', 'height', 'volume']
df.head()<jupyter_output><empty_output><jupyter_text>Make a quick plot.<jupyter_code>plt.figure()
plt.plot(df.ID, df.girth, '-')
plt.grid()
plt.xlabel('Tree ID')
plt.ylabel('Girth (ft)')
plt.title('Tree girth')
plt.tight_layout()<jupyter_output><empty_output><jupyter_text>Calculate the means<jupyter_code>means = df.mean()
# means = means.to_frame().T
print(means)
means = pd.DataFrame([[means.girth, means.height, means.volume]], columns=['girth', 'height', 'volume'])<jupyter_output><empty_output><jupyter_text>Save the resultsSave the estimate trend to a CSV file.<jupyter_code>means.to_csv('../../results/mean-data.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15532286212914484, 'fraction_numerical': 0.0, 'mean_word_length': 6.910344827586207, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '648020', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 430, 'n_tokens_neox': 412, 'n_words': 88, 'path': 'code/notebooks/get-mean-height.ipynb', 'repo_name': 'navishwadhwa/reproducible-manuscript-template', 'size': '1146'}