# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3.7.4 64-bit
#     name: python374jvsc74a57bd07945e9a82d7512fbf96246d9bbc29cd2f106c1a4a9cf54c9563dadf10f2237d4
# ---

# # Chipotle **

#
# ### Step 1. Import the necessary libraries

# +

# remember to %matplotlib inline
import pandas as pd 
import matplotlib as mp 
import numpy as np
import scipy.stats as stats
import seaborn as sns
sns.set_context('notebook')
sns.set_style('darkgrid')
# -

# ### Step 2. Import the dataset of `chipotle` and assign it to a variable called chipo.

# +

chipo=pd.read_csv("https://raw.githubusercontent.com/justmarkham/DAT8/master/data/chipotle.tsv",sep="\t")
chipo
# -

# ### Step 3. See the first 10 entries

chipo[0:10]

# ### Step 4. Create a histogram of the top 5 items bought

# +

sns.histplot(data=chipo.sort_values('quantity', ascending=False).groupby('item_name').head(1)[0:5],y="item_name",x="quantity") #helpesita aqui que no se hacer el grafico este me estoy volviendo LOCO  

# -

chipo.sort_values("quantity", ascending=False).groupby(by="item_name")

# ### Step 5. Create a scatterplot with the number of items orderered per order price
#
# Make sure you get the same labels and title
# #### Hint: Price should be in the X-axis and Items ordered in the Y-axis

# +
chipo["item_price"]=chipo["item_price"].apply(lambda x:x.lstrip("$"))


# -

chipo["item_price"] = chipo["item_price"].astype(float)
chipo

sns.scatterplot(data=chipo.groupby("order_id").sum("item_price"), x="item_price", y="quantity",color="green")



StarcoderdataJupyterScriptsDedupFiltered