<jupyter_start><jupyter_text>Ex1 - Filtering and Sorting 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
import numpy as np<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>chipo = pd.read_table("https://raw.githubusercontent.com/justmarkham/DAT8/master/data/chipotle.tsv")
chipo.item_price.max()<jupyter_output><empty_output><jupyter_text>Step 4. How many products cost more than $10.00?<jupyter_code>dollarizer = lambda x: float(x[1:-1])
chipo.item_price = chipo.item_price.apply(dollarizer)
chipo.item_price.max()<jupyter_output><empty_output><jupyter_text>Step 5. What is the price of each item?  print a data frame with only two columns item_name and item_price<jupyter_code>chipo.loc[:,["item_name","item_price"]]<jupyter_output><empty_output><jupyter_text>Step 6. Sort by the name of the item<jupyter_code>chipo.sort_values(by="item_name")<jupyter_output><empty_output><jupyter_text>Step 7. What was the quantity of the most expensive item ordered?<jupyter_code>chipo.sort_values(by = "item_price", ascending = False).head(1)<jupyter_output><empty_output><jupyter_text>Step 8. How many times were a Veggie Salad Bowl ordered?<jupyter_code>c = chipo.groupby(by=chipo.choice_description).count()
c<jupyter_output><empty_output><jupyter_text>Step 9. How many times people orderd more than one Canned Soda?<jupyter_code>chipo[(chipo.item_name=="Canned Soda") & (chipo.item_price>1)]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11204954954954954, 'fraction_numerical': 0.01126126126126126, 'mean_word_length': 7.668292682926829, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 34, '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': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '350143', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 635, 'n_tokens_neox': 617, 'n_words': 137, 'path': '02_Filtering_&_Sorting/Chipotle/Exercises.ipynb', 'repo_name': 'Gioparra91/Pandas-exercise', 'size': '1776'}