<jupyter_start><jupyter_text>Visualizing Chipotle's Data This time we are going to pull data directly from the internet.Special thanks to: https://github.com/justmarkham for sharing the dataset and materials. Step 1. Import the necessary libraries<jupyter_code>import pandas as pd
from collections import Counter
import matplotlib.pyplot as plt 

# set this so the graphs open internally
%matplotlib inline<jupyter_output><empty_output><jupyter_text>Step 2. Import the dataset from this [address](https://raw.githubusercontent.com/justmarkham/DAT8/master/data/chipotle.tsv).   Step 3. Assign it to a variable called chipo.<jupyter_code>url = "https://raw.githubusercontent.com/justmarkham/DAT8/master/data/chipotle.tsv"
chipo = pd.read_table(url)<jupyter_output><empty_output><jupyter_text>Step 4. See the first 10 entries<jupyter_code>chipo.head()<jupyter_output><empty_output><jupyter_text>Step 5. Create a histogram of the top 5 items bought<jupyter_code>x = chipo.item_name
letter_counts = Counter(x)
df = pd.DataFrame.from_dict(letter_counts, orient="index")
df = df[0].sort_values(ascending = True)[45:50]
df.plot(kind="bar")

plt.xlabel("Items")
plt.ylabel("Price")
plt.title("Most ordered Chipotle\'s Items")

plt.show()<jupyter_output><empty_output><jupyter_text>Step 6. Create a scatterplot with the number of items orderered per order price Hint: Price should be in the X-axis and Items ordered in the Y-axis<jupyter_code>chipo.item_price = [float(value[1:-1]) for value in chipo.item_price]
orders = chipo.groupby(by="order_id").sum()
plt.scatter(x=orders.item_price, y=orders.quantity, s=50, c="red")

plt.xlabel('Order Price')
plt.ylabel('Items ordered')
plt.title('Number of items ordered per order price')
plt.ylim(0)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11571185479296653, 'fraction_numerical': 0.01191151446398185, 'mean_word_length': 6.703056768558952, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 3, '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': '146010', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 631, 'n_tokens_neox': 595, 'n_words': 151, 'path': '07_Visualization/Chipotle/Exercises.ipynb', 'repo_name': 'Gioparra91/Pandas-exercise', 'size': '1763'}