<jupyter_start><jupyter_text>Bar Charts and Histograms As always, let's begin by importing our necessary packages and reading in/previewing our data. In this practice we will continue to explore the `titanic` dataset.<jupyter_code># import seaborn

# set up for inline plotting

# read in titanic data

# preview data<jupyter_output><empty_output><jupyter_text>Bar ChartsGenerate a barplot of `survived` (y-axis) across `sex` (x-axis).<jupyter_code># barplot of sex vs survived<jupyter_output><empty_output><jupyter_text>Now, generate a barplot of `survived` (y-axis) across `sex` (x-axis), stratified by `class`. Choose your favorite color palette.<jupyter_code># barplot of sex vs survived stratified by class<jupyter_output><empty_output><jupyter_text>HistogramsGenerate a histogram of `fare`<jupyter_code>#histogram of fare<jupyter_output><empty_output><jupyter_text>Now let's play with the `bins` parameter. First let's try a small number of bins, like 10:<jupyter_code>#histogram of fare with 10 bins<jupyter_output><empty_output><jupyter_text>Now, let's try a larger number of bins, say 100.<jupyter_code>#histogram of fare with 100 bins<jupyter_output><empty_output><jupyter_text>As you can see, most of the values are pretty small (< 100 dollars), and there are only a few really large values. This is called a long-tailed distribution. Can you plot a histogram of just the fares that are less than 100 dollars?<jupyter_code>#histogram of fare<jupyter_output><empty_output><jupyter_text>Count PlotsGenerate a count plot to visualize the distribution the `deck` variable across all passengers in our data set. Choose a sequential color palette.<jupyter_code># count plot of deck<jupyter_output><empty_output><jupyter_text>Now stratify your plot using the `class` variable. What kind of color palette is appropriate now?<jupyter_code># count plot of deck stratified by class<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07849293563579278, 'fraction_numerical': 0.00837257980115123, 'mean_word_length': 6.966666666666667, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '214534', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 628, 'n_tokens_neox': 585, 'n_words': 215, 'path': 'Practices/Practice27_BarCharts_Histograms.ipynb', 'repo_name': 'lechten/curriculum-notebooks', 'size': '1911'}