<jupyter_start><jupyter_text>Exercise - A Preview of Data Science ToolsIn the following cell two lists of weight (in lbs) and height (in inches) of 6 basketball players are given:<jupyter_code>height_in = [73, 74, 71, 75, 74, 72, 70, 71, 68, 69, 72, 71]
weight_lb = [170 , 215, 210 , 204, 189, 195, 190, 194, 200, 178, 199, 202]<jupyter_output><empty_output><jupyter_text>Import the numpy package as np<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>Create 2 numpy arrays, `np_height_in` & `np_weight_lb`, from height and weight. Hint: one can make a numpy array from a python list, L, by `np.array(L)`.<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>Checkout the type of np_weight_lb:<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>This is how `np_weight_lb` will look like after the conversion:<jupyter_code>np_weight_lb<jupyter_output><empty_output><jupyter_text>Convert `np_height_in` to meters and call it `np_height_m`, then print it. Hint: Use the formula $height(m) = height(in) * 2.54\  /\  100$.<jupyter_code># Your answer goes here<jupyter_output>[1.8542 1.8796 1.8034 1.905  1.8796 1.8288 1.778  1.8034 1.7272 1.7526
 1.8288 1.8034]<jupyter_text>Convert `np_weight_lb` to Kgs and call it `np_weight_kg`, then print it. Hint: Use the formula $weight(kg) = weight(lb) \ /\  2.2$.<jupyter_code># Your answer goes here<jupyter_output>[77.27272727 97.72727273 95.45454545 92.72727273 85.90909091 88.63636364
 86.36363636 88.18181818 90.90909091 80.90909091 90.45454545 91.81818182]<jupyter_text>Using `np_weight_kg` and `np_height_m` create a simple scatter plot. Hint: to do this you have several options, here are two of them: 1) use `plt.plot(x, y, 'o')`. The option 'o' here creates a scatter plot with circles; checkout help `plt.plot?` to find out about other symbols. 2) use `plt.scatter(x, y)` function.<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>Now try to use the second option. But this time also use `plt.xlabel("X-label")` & ``plt.ylabel("Y-label")`` to give the axis appropriate names:<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>Calculate bmi and call it `bmi`, round it to 2 digits and print it. Hint: $bmi = weight(kg)\  /\  height ^ 2(m)$.<jupyter_code># Your answer goes here<jupyter_output>[22. 28. 29. 26. 24. 27. 27. 27. 30. 26. 27. 28.]<jupyter_text>Checkout the type of `bmi`:<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>Create a Pandas dafaframe from np_weight_kg, np_height_m, bmi with the column names `weight`, `height`, `bmi`. Call this dataframe `players`:<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>See if you can reproduce the above plot by using DataFrame method `.plot.scatter()` on `players` DataFrame:<jupyter_code># Your answer goes here<jupyter_output><empty_output><jupyter_text>Now with ggplot style:<jupyter_code># Your answer goes here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11637790127492645, 'fraction_numerical': 0.09022556390977443, 'mean_word_length': 6.083333333333333, 'pattern_counts': {'":': 0, '<': 54, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '160308', 'license': 'MIT', 'n_tokens_mistral': 1345, 'n_tokens_neox': 1128, 'n_words': 335, 'path': '02-Data-Import-Export/Exercise-01-Preview-of-Data-Science-Tools.ipynb', 'repo_name': 'nikkiii66/Intro-to-Data-Analytics', 'size': '3059'}