# ---
# 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="sHrEKL2v2YfS" colab_type="code" colab={}
# #!pip install datadotworld
# #!pip install datadotworld[pandas]

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

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

import datadotworld as dw

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

# + id="0pmti3Ny435n" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="c16ec156-bcca-4786-b346-c303774999f2" executionInfo={"status": "ok", "timestamp": 1581619939686, "user_tz": -60, "elapsed": 896, "user": {"displayName": "<NAME>\u015bniewski", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# cd "drive/My Drive/Colab Notebooks/ml-dw-matrix"

# + id="V_1Zd_dv5CPR" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="504cc2af-1a03-471d-92c3-edf4d3c60425" executionInfo={"status": "ok", "timestamp": 1581619959894, "user_tz": -60, "elapsed": 2506, "user": {"displayName": "<NAME>\u015bniewski", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# ls matrix_one/

# + id="31h-Sis_5RKV" colab_type="code" colab={}
# !mkdir data

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

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

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

# + id="pdCkvAr952ZB" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 124} outputId="5fe6001d-df94-43ac-b3f0-0a4073119228" executionInfo={"status": "ok", "timestamp": 1581620140486, "user_tz": -60, "elapsed": 1866, "user": {"displayName": "<NAME>\u015bniewski", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
df = data.dataframes['7004_1']
df.shape

# + id="Fy0nozKP57-D" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 678} outputId="4bd3b420-3a36-4f43-b061-4cf6ed65e0b8" executionInfo={"status": "ok", "timestamp": 1581620174223, "user_tz": -60, "elapsed": 752, "user": {"displayName": "<NAME>\u015bniewski", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
df.sample(5)

# + id="ZdCp2pFU6JnY" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 225} outputId="2067970f-cb94-4486-fb9f-1628bc937297" executionInfo={"status": "ok", "timestamp": 1581620191353, "user_tz": -60, "elapsed": 420, "user": {"displayName": "<NAME>\u015bniewski", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
df.columns

# + id="g_BeunYe6N20" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 104} outputId="f23e3997-f938-46f0-ce06-72f2158dc70b" executionInfo={"status": "ok", "timestamp": 1581620210192, "user_tz": -60, "elapsed": 738, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
df.prices_currency.unique()

# + id="L-84qngs6SaV" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 260} outputId="8630d98b-7905-44f4-eb96-86ec9b650c7f" executionInfo={"status": "ok", "timestamp": 1581620238032, "user_tz": -60, "elapsed": 646, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
df.prices_currency.value_counts()

# + id="Geg_dfrj6ZO6" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 260} outputId="048127eb-427e-4160-b1ba-701f234bbc20" executionInfo={"status": "ok", "timestamp": 1581620259615, "user_tz": -60, "elapsed": 911, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
df.prices_currency.value_counts(normalize=True)

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

# + id="ECeK_MiN6yn3" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="cbf756a9-df2f-40e0-b6e9-fe916b6ec1ac" executionInfo={"status": "ok", "timestamp": 1581620355633, "user_tz": -60, "elapsed": 617, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
df_usd.shape

# + id="_7Sks_fL60tq" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 282} outputId="4e47333a-f378-4f88-82b3-d835461bf64b" executionInfo={"status": "ok", "timestamp": 1581620489574, "user_tz": -60, "elapsed": 906, "user": {"displayName": "<NAME>\u015bniewski", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
df_usd['prices_amountmin'] = df_usd.prices_amountmin.astype(np.float)
df_usd['prices_amountmin'].hist()

# + id="hQLdWpFM6_Zb" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="1e8b352e-47b3-4873-cb30-57fde7fb1fb3" executionInfo={"status": "ok", "timestamp": 1581620621352, "user_tz": -60, "elapsed": 953, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
filter_max = np.percentile(df_usd['prices_amountmin'], 99)
filter_max

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

# + id="kJrzBRc674MS" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 282} outputId="78ebb4a5-3650-431d-f452-adc065773f02" executionInfo={"status": "ok", "timestamp": 1581620708427, "user_tz": -60, "elapsed": 910, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
df_usd_filter.prices_amountmin.hist(bins=100)

# + id="5ntsEbVL75xq" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="5d8b4ebc-2137-4d70-f0ff-e34edadac3af" executionInfo={"status": "ok", "timestamp": 1581620837927, "user_tz": -60, "elapsed": 2749, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# ls

# + id="E77WGqvP8rFQ" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 34} outputId="1b059229-6752-4c01-97ef-7926ac1c851a" executionInfo={"status": "ok", "timestamp": 1581620857385, "user_tz": -60, "elapsed": 2564, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# ls matrix_one/

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

# + id="ggykMW3Y82Y_" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 295} outputId="b0a88415-367c-4a6d-e4f8-0abe21dbcfe0" executionInfo={"status": "ok", "timestamp": 1581621024238, "user_tz": -60, "elapsed": 4118, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# !git status

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

# + id="rasV_kG59erT" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 350} outputId="db18cbcc-6dbc-4be5-e51b-880ba550533e" executionInfo={"status": "ok", "timestamp": 1581621056731, "user_tz": -60, "elapsed": 3051, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# !git diff

# + id="eVB412cK9ghA" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 225} outputId="aa15b085-0619-4550-960d-18031a2cf8d7" executionInfo={"status": "ok", "timestamp": 1581621113611, "user_tz": -60, "elapsed": 3418, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# !git commit -m "Read Men's Shoe Prices dataset from data.world"

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

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

# + id="00EDVsT597L6" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 86} outputId="5b3c5d54-3bfb-41cc-99c9-3fd625c2ccc7" executionInfo={"status": "ok", "timestamp": 1581621177800, "user_tz": -60, "elapsed": 8114, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# !git commit -m "Read Men's Shoe Prices dataset from data.world"

# + id="Pu0Wuj0k982U" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 139} outputId="cda48117-8fb8-48e9-9689-eddd89526098" executionInfo={"status": "ok", "timestamp": 1581621204825, "user_tz": -60, "elapsed": 7965, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# !git push

# + id="3cglsbkP-De9" colab_type="code" colab={}
# !git reset --soft HEAD^

# + id="K3StjkOQ-hfF" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 104} outputId="5e2f0295-48bd-4816-a954-fd91fbc2471e" executionInfo={"status": "ok", "timestamp": 1581621336007, "user_tz": -60, "elapsed": 3250, "user": {"displayName": "<NAME>", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# !git commit -am "day 3 - Mens shoes"

# + id="ja8ox80R-kqu" colab_type="code" colab={"base_uri": "https://localhost:8080/", "height": 173} outputId="381c7d7d-c9d8-4354-d88b-58e2f1e7a364" executionInfo={"status": "ok", "timestamp": 1581621351824, "user_tz": -60, "elapsed": 5566, "user": {"displayName": "<NAME>\u015bniewski", "photoUrl": "https://lh3.googleusercontent.com/a-/AAuE7mBtlAHi7LnttjKcyTVvnSOV4V06f083EsiIucK8jw=s64", "userId": "06218853652600346861"}}
# !git push -f -u origin master

# + id="fIeEheO6-n9W" colab_type="code" colab={}


StarcoderdataJupyterScriptsDedupFiltered