<jupyter_start><jupyter_text>Online Retails Purchase  Introduction: Step 1. Import the necessary libraries<jupyter_code>import pandas as pd
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>Step 2. Import the dataset from this [address](https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/07_Visualization/Online_Retail/Online_Retail.csv).   Step 3. Assign it to a variable called online_rtNote: if you receive a utf-8 decode error, set `encoding = 'latin1'` in `pd.read_csv()`.<jupyter_code>df=pd.read_csv('https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/07_Visualization/Online_Retail/Online_Retail.csv', encoding= 'latin1')
df.head()<jupyter_output><empty_output><jupyter_text>Step 4. Create a histogram with the 10 countries that have the most 'Quantity' ordered except UK  [  ] ¿cómo asignar un color a cada país?<jupyter_code>dfsel=df.groupby('Country').Quantity.sum().reset_index().sort_values('Quantity', ascending= False)
dfsel=dfsel.iloc[1:11, :]

dfsel.columns
dfsel.plot(x= 'Country', y= 'Quantity', kind= 'bar', stacked= True, colormap= 'Paired' )

plt.xlabel('Countries')
plt.ylabel('Quantity')
plt.title('10 Countries with most orders')<jupyter_output><empty_output><jupyter_text>Step 5.  Exclude negative Quantity entries<jupyter_code>df= df[df.Quantity>0]
df<jupyter_output><empty_output><jupyter_text>Step 6. Create a scatterplot with the Quantity per UnitPrice by CustomerID for the top 3 Countries (except UK)  [  ] ¿cómo se haría?<jupyter_code>dfsel=df.groupby(['Country', 'CustomerID']).sum().reset_index()
dfsel<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12476951444376153, 'fraction_numerical': 0.013521819299323909, 'mean_word_length': 7.613756613756614, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 22, 'https://': 2, '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': '505289', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 600, 'n_tokens_neox': 568, 'n_words': 122, 'path': '07_Visualization/[  ] Online_Retail/[  ] One retail.ipynb', 'repo_name': 'apoboldon/pandas_exercises', 'size': '1627'}