# ---
# 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="4WkKysp1WiQv" colab_type="code" colab={}
from google.colab import drive
import pandas as pd
import numpy as np

import datadotworld as dw

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

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

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

# + id="J9OsQMB-ZDur" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="2153f8d0-f7a3-40f1-9252-a10b01f438b7" executionInfo={"status": "ok", "timestamp": 1581527808835, "user_tz": -60, "elapsed": 1704, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
 cd "drive//My Drive/Colab Notebooks/dw_Matrix"


# + id="uW13OtDqZzQ2" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="874653d8-1371-4986-db42-df923009cc5d" executionInfo={"status": "ok", "timestamp": 1581527848289, "user_tz": -60, "elapsed": 4856, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
# ls matrix_one

# + id="N-TjBv2lZ8IR" colab_type="code" colab={}
# !mkdir data

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

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

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

# + id="iyQVMMlRa_YN" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 125} outputId="5723252d-8012-47d8-8e28-fe3db868ae27" executionInfo={"status": "ok", "timestamp": 1581528230607, "user_tz": -60, "elapsed": 1789, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
df = data.dataframes['7004_1']
df.shape

# + id="bqrWzOKbbMFR" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 618} outputId="4857aee8-ffe6-460e-d74b-4bb2b1920416" executionInfo={"status": "ok", "timestamp": 1581528255217, "user_tz": -60, "elapsed": 678, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
df.sample(5)

# + id="bt3HhnHZbgfp" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 228} outputId="20616b4d-f7b9-432e-bb3f-98df55ca43c5" executionInfo={"status": "ok", "timestamp": 1581528377531, "user_tz": -60, "elapsed": 680, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
df.columns

# + id="0Dny0JP7btA9" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 105} outputId="a4670222-647e-4ede-dd3c-d7a07bb74fa6" executionInfo={"status": "ok", "timestamp": 1581528433818, "user_tz": -60, "elapsed": 786, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
df.prices_currency.unique()

# + id="ljR6A-gIcMEs" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 263} outputId="f4c2d3d9-2919-40da-e417-c355d90e6af4" executionInfo={"status": "ok", "timestamp": 1581528514611, "user_tz": -60, "elapsed": 662, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
df.prices_currency.value_counts(normalize=True)

# + id="dkCKn3_ncYlq" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="367983c9-cb97-45c9-965f-c2034a6524b2" executionInfo={"status": "ok", "timestamp": 1581528634527, "user_tz": -60, "elapsed": 771, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
df_usd = df[ df.prices_currency == 'USD'].copy()
df_usd.shape

# + id="7be_bhe4c9D2" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 283} outputId="3738e74d-4553-47fb-983e-c618a3e9681c" executionInfo={"status": "ok", "timestamp": 1581528921310, "user_tz": -60, "elapsed": 741, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
df_usd['prices_amountmin'] = df_usd.prices_amountmin.astype(np.float)
df_usd['prices_amountmin'].hist()

# + id="XJtTC3bWdcds" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="2e8aceb8-2cbd-456c-f53a-c7d87d18ce58" executionInfo={"status": "ok", "timestamp": 1581529127694, "user_tz": -60, "elapsed": 750, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
filter_max = np.percentile(df_usd['prices_amountmin'],99)
filter_max

# + id="F-aOJaDYeN9y" colab_type="code" colab={}
df_usd_filter = df_usd[ df_usd['prices_amountmin'] < filter_max ]

# + id="52nUZN_zeuDN" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 283} outputId="727f77eb-e68f-4c7f-acf8-89779a87e895" executionInfo={"status": "ok", "timestamp": 1581529280544, "user_tz": -60, "elapsed": 1193, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
df_usd_filter.prices_amountmin.hist(bins=100)

# + id="2ZYV48WofMbu" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="b02821cd-dbfc-4514-dc81-e09ac8a46597" executionInfo={"status": "ok", "timestamp": 1581529539988, "user_tz": -60, "elapsed": 1824, "user": {"displayName": "<NAME>", "photoUrl": "", "userId": "02669959677222457689"}}
# ls matrix_one

# + id="wYBUAU74gWJT" colab_type="code" colab={}


StarcoderdataJupyterScriptsDedupFiltered