# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + id="NTdLWO7zMXE2" colab_type="code" colab={}
# #!pip install datadotworld
# #!pip install datadotworld[pandas]

# + id="si0NCWm2NG9A" colab_type="code" colab={}
# #!dw configure


# + id="q8IuYlwpLtC7" colab_type="code" colab={}
from google.colab import drive
import pandas as pd
import numpy as np

import datadotworld as dw

# + id="FNY4HSOpNmh9" colab_type="code" colab={}
#drive.mount("/content/drive")

# + id="VK2SKhxuOAr4" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="f62c904a-65ea-4170-f8d8-e209563dc556" executionInfo={"status": "ok", "timestamp": 1581541546977, "user_tz": -60, "elapsed": 691, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
# cd "drive/My Drive/Colab Notebooks/dw_matrix"

# + id="WWMu1P2nOWVf" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="bae60f85-c71f-4f33-dc0a-52179da3015c" executionInfo={"status": "ok", "timestamp": 1581541712478, "user_tz": -60, "elapsed": 2516, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
# ls matrix_one/

# + id="8c6Tr53tO1dA" colab_type="code" colab={}
# !mkdir data

# + id="iN3ZO7mLO3u5" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="86e4eaea-90ee-4f1a-fa54-20d173e7ea5e" executionInfo={"status": "ok", "timestamp": 1581541726818, "user_tz": -60, "elapsed": 2267, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
# ls

# + id="WbQ03Ob8O5D5" colab_type="code" colab={}
# !echo 'data' > .gitignore

# + id="dxn5TqjaPLbQ" colab_type="code" colab={}
# !git add .gitignore

# + id="a9AA4XaOPVbg" colab_type="code" colab={}
data = dw.load_dataset('datafiniti/mens-shoe-prices')

# + id="XKRsv2UPPwJp" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="a9ad649a-905a-4d2d-9a16-c2f92403be3b" executionInfo={"status": "ok", "timestamp": 1581542026542, "user_tz": -60, "elapsed": 624, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
df = data.dataframes['7004_1']
df.shape

# + id="gafZfwIkPyIQ" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 1000} outputId="dc91a245-018d-45d8-b604-f2537d45673b" executionInfo={"status": "ok", "timestamp": 1581542090530, "user_tz": -60, "elapsed": 551, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
df.prices_currency.unique

# + id="YVvXYwc6QSPj" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 108} outputId="db4d4b56-68d3-4d80-a3f5-591d7ac16493" executionInfo={"status": "ok", "timestamp": 1581542129751, "user_tz": -60, "elapsed": 595, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
df.prices_currency.unique()

# + id="42fcafmrQb0e" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 271} outputId="e4db7426-e3e8-4a73-a246-2817c1abf873" executionInfo={"status": "ok", "timestamp": 1581542211959, "user_tz": -60, "elapsed": 604, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
df.prices_currency.value_counts(normalize=True)

# + id="ad-u_xnXQoLq" colab_type="code" colab={}
df_usd = df[ df.prices_currency == 'USD'].copy()

# + id="C90DvDgLRN3P" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="b274a54f-8c31-4a79-e024-142c4d26dc5e" executionInfo={"status": "ok", "timestamp": 1581542343732, "user_tz": -60, "elapsed": 580, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
df_usd.shape

# + id="BoBD5hk3RQCf" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="f438ec18-2c32-4778-813e-c07943212e45" executionInfo={"status": "ok", "timestamp": 1581542756615, "user_tz": -60, "elapsed": 637, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
#df_usd['prices_amountmin'] = df_usd.prices_amountmin.astype(np.float)
#df_usd['prices_amountmin'].hist()
filter_max = np.percentile( df_usd['prices_amountmin'], 99)
filter_max

# + id="9DHZ_DuJS12A" colab_type="code" colab={}
df_usd_filter = df_usd[ df_usd['prices_amountmin'] < filter_max]

# + id="2yOSF87FTKLK" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 283} outputId="b6374502-d530-4601-b748-5443a187d7a9" executionInfo={"status": "ok", "timestamp": 1581542931454, "user_tz": -60, "elapsed": 971, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
df_usd_filter.prices_amountmin.hist(bins=100)

# + id="AwLR093PTSKx" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="ddfa3ba4-641d-4411-e381-71a7a406e434" executionInfo={"status": "ok", "timestamp": 1581543080213, "user_tz": -60, "elapsed": 2136, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
# ls

# + id="pqUxu23iUDel" colab_type="code" colab={}
# !git add matrix_one/day3.ipynb

# + id="QR9dShK_UOjt" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 90} outputId="97502e2c-c21e-4ec3-a818-7bfa4e8a1a78" executionInfo={"status": "ok", "timestamp": 1581543307465, "user_tz": -60, "elapsed": 3771, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
# !git commit -m "Read Mens Shoe Prices datasets from data.world"

# + id="lH7EdMZbUmym" colab_type="code" colab={}
# !git config --global user.email "<EMAIL>"
# !git config --global user.name "<NAME>"

# + id="YjCpo2tIUtGS" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 162} outputId="b933ac2d-c64c-4397-ca8d-402d4989530d" executionInfo={"status": "ok", "timestamp": 1581543532919, "user_tz": -60, "elapsed": 7110, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "16976498748836099594"}}
# !git push -u origin master

# + id="7Wy53_TQVwzS" colab_type="code" colab={}


StarcoderdataJupyterScriptsDedupFiltered