Cleaned up some folders and small Walmart template changes.

This commit is contained in:
Norm Rasmussen
2025-04-08 10:22:57 -04:00
parent e5e1bf3acd
commit a035c58c95
23 changed files with 49 additions and 18582 deletions

View File

@ -7,7 +7,7 @@
<script>
document.addEventListener("DOMContentLoaded", () => {
const btn = document.querySelector('.event-status');
const btn = document.querySelector('.np-training-session-cta-note');
if (btn) {
const eventId = btn.getAttribute('data-event-id');

View File

@ -11,7 +11,7 @@
{% for course in courses.in_catalog %}
{% for category in course.categories %}
{% if available_categories contains category.name %}
<script> console.log("{{ course.name }} + {{ category.name }}")</script>
{% comment %} <script> console.log("{{ course.name }} + {{ category.name }}")</script> {% endcomment %}
{% unless uniq_cats contains category.name %}
<a class="category-card" id="{{category.name}}" href="/app/catalog?filter[category_uuid][in][]={{category.id}}&search_terms=">
<img class="category-card-image" src="" alt="">

View File

@ -19,15 +19,18 @@
{% for course in courses.enrolled %}
{% assign countTotal = countTotal | plus: 1 %}
{% if course.progress == 100 %}
<script> console.log('{{ course.name }}--{{ course.progress}}') </script>
{% assign countComplete = countComplete | plus: 1 %}
{% endif %}
{% if course.progress > 0 and course.progress < 100 %}
<script> console.log('{{ course.name }}--{{ course.progress}}') </script>
{% assign countInProgress = countInProgress | plus: 1 %}
{% endif %}
{% if course.progress == 0 %}
{% assign countNotStarted = countNotStarted | plus: 1 %}
{% endif %}
{% endfor %}
<script> console.log('{{ countTotal }}')</script>
<ul class="progress-circle-list">
<li>
{%

View File

@ -6,3 +6,17 @@
</main>
{% include "footer" %}
<script>
$(document).ready(function() {
if(document.querySelector('[class="sc-cjbZfG loiSUP Transcript_Caption"]').innerHTML.includes('Transcript for')) {
document.querySelector('[class="sc-cjbZfG loiSUP Transcript_Caption"]').innerHTML = "<h3 class='sc-cjbZfG loiSUP Transcript_Caption'>Transcript</h3>";
}
});
</script>
<style>
.Transcript_Caption {
color: white;
}
</style>

BIN
Scripts/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,269 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "3bc892c3",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"hello world\n"
]
}
],
"source": [
"print(\"hello world\")"
]
},
{
"cell_type": "markdown",
"id": "725bdfc5",
"metadata": {},
"source": [
"This is a markdown tile. Testing. this."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "89eea5d5",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>OrgID</th>\n",
" <th>Organization</th>\n",
" <th>Churn Date</th>\n",
" <th>2022-01</th>\n",
" <th>2022-02</th>\n",
" <th>2022-03</th>\n",
" <th>2022-04</th>\n",
" <th>2022-05</th>\n",
" <th>2022-06</th>\n",
" <th>2022-07</th>\n",
" <th>2022-08</th>\n",
" <th>2022-09</th>\n",
" <th>2022-10</th>\n",
" <th>2022-11</th>\n",
" <th>2022-12</th>\n",
" <th>2023-01</th>\n",
" <th>2023-02</th>\n",
" <th>2023-03</th>\n",
" <th>2023-04</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>30867753</td>\n",
" <td>Aquent</td>\n",
" <td>2023-04</td>\n",
" <td>58</td>\n",
" <td>38</td>\n",
" <td>50</td>\n",
" <td>50</td>\n",
" <td>39</td>\n",
" <td>36</td>\n",
" <td>46</td>\n",
" <td>46</td>\n",
" <td>43.0</td>\n",
" <td>27.0</td>\n",
" <td>24.0</td>\n",
" <td>26</td>\n",
" <td>22</td>\n",
" <td>8.0</td>\n",
" <td>10.0</td>\n",
" <td>2.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>33375202</td>\n",
" <td>BioLife Solutions, Inc.</td>\n",
" <td>2023-04</td>\n",
" <td>11</td>\n",
" <td>7</td>\n",
" <td>4</td>\n",
" <td>11</td>\n",
" <td>4</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>30867495</td>\n",
" <td>ZyXel Communications Inc</td>\n",
" <td>2023-04</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>4</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>1.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>32999202</td>\n",
" <td>BrightLine Eating Solutions LLC</td>\n",
" <td>2023-03</td>\n",
" <td>10,362</td>\n",
" <td>7,890</td>\n",
" <td>7,272</td>\n",
" <td>8,177</td>\n",
" <td>8,468</td>\n",
" <td>7,524</td>\n",
" <td>8,509</td>\n",
" <td>5,638</td>\n",
" <td>581.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>30867752</td>\n",
" <td>Casio America Inc</td>\n",
" <td>2023-03</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" OrgID Organization Churn Date 2022-01 2022-02 \n",
"0 30867753 Aquent 2023-04 58 38 \\\n",
"1 33375202 BioLife Solutions, Inc. 2023-04 11 7 \n",
"2 30867495 ZyXel Communications Inc 2023-04 1 1 \n",
"3 32999202 BrightLine Eating Solutions LLC 2023-03 10,362 7,890 \n",
"4 30867752 Casio America Inc 2023-03 NaN NaN \n",
"\n",
" 2022-03 2022-04 2022-05 2022-06 2022-07 2022-08 2022-09 2022-10 2022-11 \n",
"0 50 50 39 36 46 46 43.0 27.0 24.0 \\\n",
"1 4 11 4 NaN NaN NaN NaN NaN NaN \n",
"2 2 1 2 4 2 2 1.0 NaN NaN \n",
"3 7,272 8,177 8,468 7,524 8,509 5,638 581.0 NaN NaN \n",
"4 NaN NaN NaN 1 NaN NaN NaN NaN NaN \n",
"\n",
" 2022-12 2023-01 2023-02 2023-03 2023-04 \n",
"0 26 22 8.0 10.0 2.0 \n",
"1 NaN NaN NaN NaN NaN \n",
"2 NaN NaN 1.0 1.0 NaN \n",
"3 NaN NaN NaN NaN NaN \n",
"4 NaN NaN NaN NaN NaN "
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"import sketch\n",
"cd = pd.read_csv(\"/Users/normrasmussen/Downloads/churned_analysis.csv\")\n",
"cd.head()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "b7cf96bb",
"metadata": {},
"outputs": [],
"source": [
"# Replace all NaN values with 0\n",
"cd.fillna(0, inplace=True)\n",
"\n",
"# Remove all commas from strings\n",
"cd.replace(',','', regex=True, inplace=True)\n",
"\n",
"# Convert all strings after the column 'Churn Data' to integers\n",
"for col in cd.columns[4:]:\n",
" cd[col] = cd[col].astype(int)\n",
"\n",
"cd.drop(columns=['OrgID'], inplace=True)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +0,0 @@
"Evaluate: Implementation Training 1 - Configuration and Setting","b2f38d8e-9262-4b30-8674-3c1e6a79bf54"
"Evaluate: Implementation Training 2 - Establish and Launch Evaluations","aa7d84cb-d2c6-475a-961e-19233ed01b40"
"Evaluate: Implementation Training 3 - User Experience","45e3aeba-3923-46f7-853a-a9317692339a"
"Evaluate: Implementation Training 4 - Reporting","55841904-8c6a-4676-a43f-b5cdd360973e"
"Evaluate: New Feature Releases","c19a3ced-d66b-4524-bc96-7a7aa7443151"
"Evaluate: The Mailing Center","6d20dd98-99d1-4659-83d8-2354e096b90e"
"Evaluate: New Faculty Training","7edfe3cf-db22-4476-9791-8fe066680733"
"Evaluate: Site Administrator Transition","8f743b2c-d32e-462a-8a55-0c4e7bcf24f4"
"Evaluate: The Student Experience","27a3dd65-409e-4983-a2de-4269d3b490e3"
"Raise: System Administration - Customizing Entities, Fields, and Relationships Training Manual","b8ce96a5-f895-4d5f-ad50-4e92912998c4"
"Raise: System Administration - Data Import and Export Training Manual","ddf88f38-2956-444e-a68b-62f8df0627d9"
"Raise: System Administration -DocumentsCorePack Installation and Configuration","ef457ac9-3bf7-415f-87cd-edf86adef14d"
"Raise: System Administration - Duplication Detection and Merging Records Training Manual","f9856c21-0b45-4b4d-b7f5-73b9477394f0"
"Reach: 2.2 Release Notes - Winter 2021","7010bfb3-121e-4c8a-b988-03f24c684068"
"Reach: 2.3 Release Notes - Spring 2021","7304dbb8-481b-4c1f-bb0e-779417d4ea23"
"Reach: 3.0 Release Notes - Summer 2021","bbd5bb1f-b3bf-45a2-a047-c4ee93af18f8"
"Reach: 3.1 Release Notes - Fall 2021","73a4386a-6783-4425-9d80-f1da41da83fc"
"Reach: 3.2 Release Notes - Winter 2022","66e4c297-2645-4e2f-94cb-92faaa5e74b4"
"Reach: 3.3 Ask A Product Manager - Spring 2022","7fdc8e90-7e0c-4f63-afeb-72c26df1d528"
"Reach: 3.4 Release Notes - Summer 2022","5913d308-8ebc-41ef-aeab-3e0c7e6c07bf"
"Reach: 3.5 Release Notes - Fall 2022","17be26aa-0c84-4a4e-9fa1-33110843b5d4"
"Reach: 3.6 Release Notes - Winter 2023","15af1c44-b4b3-49db-af6f-9b5960e4bf9e"
"Reach: 4.0 Release Notes - Spring 2023","9bedb4d9-f8fd-4617-abbb-8c85db7c070f"
"Student: Configuring Area of Study","76f4497b-e288-4413-9345-49a6df163363"
"Student: Configuring Transfer Credit Statuses","aa39386f-140e-4268-951e-716faa1a7ebd"
1 Evaluate: Implementation Training 1 - Configuration and Setting b2f38d8e-9262-4b30-8674-3c1e6a79bf54
2 Evaluate: Implementation Training 2 - Establish and Launch Evaluations aa7d84cb-d2c6-475a-961e-19233ed01b40
3 Evaluate: Implementation Training 3 - User Experience 45e3aeba-3923-46f7-853a-a9317692339a
4 Evaluate: Implementation Training 4 - Reporting 55841904-8c6a-4676-a43f-b5cdd360973e
5 Evaluate: New Feature Releases c19a3ced-d66b-4524-bc96-7a7aa7443151
6 Evaluate: The Mailing Center 6d20dd98-99d1-4659-83d8-2354e096b90e
7 Evaluate: New Faculty Training 7edfe3cf-db22-4476-9791-8fe066680733
8 Evaluate: Site Administrator Transition 8f743b2c-d32e-462a-8a55-0c4e7bcf24f4
9 Evaluate: The Student Experience 27a3dd65-409e-4983-a2de-4269d3b490e3
10 Raise: System Administration - Customizing Entities, Fields, and Relationships Training Manual b8ce96a5-f895-4d5f-ad50-4e92912998c4
11 Raise: System Administration - Data Import and Export Training Manual ddf88f38-2956-444e-a68b-62f8df0627d9
12 Raise: System Administration -DocumentsCorePack Installation and Configuration ef457ac9-3bf7-415f-87cd-edf86adef14d
13 Raise: System Administration - Duplication Detection and Merging Records Training Manual f9856c21-0b45-4b4d-b7f5-73b9477394f0
14 Reach: 2.2 Release Notes - Winter 2021 7010bfb3-121e-4c8a-b988-03f24c684068
15 Reach: 2.3 Release Notes - Spring 2021 7304dbb8-481b-4c1f-bb0e-779417d4ea23
16 Reach: 3.0 Release Notes - Summer 2021 bbd5bb1f-b3bf-45a2-a047-c4ee93af18f8
17 Reach: 3.1 Release Notes - Fall 2021 73a4386a-6783-4425-9d80-f1da41da83fc
18 Reach: 3.2 Release Notes - Winter 2022 66e4c297-2645-4e2f-94cb-92faaa5e74b4
19 Reach: 3.3 Ask A Product Manager - Spring 2022 7fdc8e90-7e0c-4f63-afeb-72c26df1d528
20 Reach: 3.4 Release Notes - Summer 2022 5913d308-8ebc-41ef-aeab-3e0c7e6c07bf
21 Reach: 3.5 Release Notes - Fall 2022 17be26aa-0c84-4a4e-9fa1-33110843b5d4
22 Reach: 3.6 Release Notes - Winter 2023 15af1c44-b4b3-49db-af6f-9b5960e4bf9e
23 Reach: 4.0 Release Notes - Spring 2023 9bedb4d9-f8fd-4617-abbb-8c85db7c070f
24 Student: Configuring Area of Study 76f4497b-e288-4413-9345-49a6df163363
25 Student: Configuring Transfer Credit Statuses aa39386f-140e-4268-951e-716faa1a7ebd

View File

@ -0,0 +1,30 @@
import requests
from urllib.request import urlretrieve
# Test for Chubb
APIKEY = "RFzu130s451F2eKgm45Ck7gyWZMvGToR6Lmf2k5V"
EXTRACT = "47156f3d-277a-4c98-b2ba-732ae364270c"
FILEID = "cpxFPY"
HEADERS = {
"accept": "application/json",
"x-api-key": APIKEY
}
def get_latest_extract():
url = f"https://analytics.northpass.io/extracts/{EXTRACT}/files/latest"
resp = requests.get(url, headers=HEADERS)
print(resp.text)
data = resp.json()
print(data)
def get_info_and_download():
url = f"https://analytics.northpass.io/extracts/{EXTRACT}/files/{FILEID}/download"
resp = requests.get(url, headers=HEADERS)
data = resp.json()
print(data['url'])
urlretrieve(data['url'], 'Chubb_MCA.csv.gz')
if __name__ == "__main__":
get_info_and_download()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +0,0 @@
from collections import Counter
import pandas as pd
basecsv = "/Users/normrasmussen/Documents/Northpass/Scripts/G2_Unenroll/skuid_05lp.csv"
def mainFunc(basecsv):
readData = pd.read_csv(
basecsv,
index_col=False,
)
parsedData = readData.drop_duplicates(subset='Course_Name', keep="first")
if parsedData.loc[readData['Course Name'].isin([
'Get Started with Models - Level 1',
'Configure Model Fields - Level 1',
'Configure Model Conditions - Level 1',
'Configure Model Actions - Level 1',
'Manage Models - Level 1',
'Intro to UI Only Fields - Level 1'])]:
extractedList = readData.loc[readData['Email'].tolist()
fourOccs = Counter(extractedList)
finalNames = []
for name, occurences in fourOccs.items():
if occurences == 6:
finalNames.append(name)
if __name__ == "__main__":
mainFunc(basecsv)

File diff suppressed because one or more lines are too long

View File

@ -1,992 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 144,
"id": "59e7fd1c-b4a6-40b6-9d14-b471cabcdcc5",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import sketch\n",
"import pandas as pd\n",
"import os\n",
"\n",
"os.environ['SKETCH_MAX_COLUMNS'] = '40'"
]
},
{
"cell_type": "code",
"execution_count": 155,
"id": "ec1df080-81d8-4e93-8fe8-6893026af6df",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"cust_data = pd.read_csv(\"/Users/normrasmussen/Downloads/churned_analysis.csv\")"
]
},
{
"cell_type": "code",
"execution_count": 156,
"id": "3c724cbb-74a9-4727-8826-ebf58afa29ad",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>OrgID</th>\n",
" <th>Organization</th>\n",
" <th>Churn Date</th>\n",
" <th>2022-01</th>\n",
" <th>2022-02</th>\n",
" <th>2022-03</th>\n",
" <th>2022-04</th>\n",
" <th>2022-05</th>\n",
" <th>2022-06</th>\n",
" <th>2022-07</th>\n",
" <th>2022-08</th>\n",
" <th>2022-09</th>\n",
" <th>2022-10</th>\n",
" <th>2022-11</th>\n",
" <th>2022-12</th>\n",
" <th>2023-01</th>\n",
" <th>2023-02</th>\n",
" <th>2023-03</th>\n",
" <th>2023-04</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>30867753</td>\n",
" <td>Aquent</td>\n",
" <td>2023-04</td>\n",
" <td>58</td>\n",
" <td>38</td>\n",
" <td>50</td>\n",
" <td>50</td>\n",
" <td>39</td>\n",
" <td>36</td>\n",
" <td>46</td>\n",
" <td>46</td>\n",
" <td>43.0</td>\n",
" <td>27.0</td>\n",
" <td>24.0</td>\n",
" <td>26</td>\n",
" <td>22</td>\n",
" <td>8.0</td>\n",
" <td>10.0</td>\n",
" <td>2.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>33375202</td>\n",
" <td>BioLife Solutions, Inc.</td>\n",
" <td>2023-04</td>\n",
" <td>11</td>\n",
" <td>7</td>\n",
" <td>4</td>\n",
" <td>11</td>\n",
" <td>4</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>30867495</td>\n",
" <td>ZyXel Communications Inc</td>\n",
" <td>2023-04</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>4</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>1.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>32999202</td>\n",
" <td>BrightLine Eating Solutions LLC</td>\n",
" <td>2023-03</td>\n",
" <td>10,362</td>\n",
" <td>7,890</td>\n",
" <td>7,272</td>\n",
" <td>8,177</td>\n",
" <td>8,468</td>\n",
" <td>7,524</td>\n",
" <td>8,509</td>\n",
" <td>5,638</td>\n",
" <td>581.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>30867752</td>\n",
" <td>Casio America Inc</td>\n",
" <td>2023-03</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>1</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" OrgID Organization Churn Date 2022-01 2022-02 \n",
"0 30867753 Aquent 2023-04 58 38 \\\n",
"1 33375202 BioLife Solutions, Inc. 2023-04 11 7 \n",
"2 30867495 ZyXel Communications Inc 2023-04 1 1 \n",
"3 32999202 BrightLine Eating Solutions LLC 2023-03 10,362 7,890 \n",
"4 30867752 Casio America Inc 2023-03 NaN NaN \n",
"\n",
" 2022-03 2022-04 2022-05 2022-06 2022-07 2022-08 2022-09 2022-10 2022-11 \n",
"0 50 50 39 36 46 46 43.0 27.0 24.0 \\\n",
"1 4 11 4 NaN NaN NaN NaN NaN NaN \n",
"2 2 1 2 4 2 2 1.0 NaN NaN \n",
"3 7,272 8,177 8,468 7,524 8,509 5,638 581.0 NaN NaN \n",
"4 NaN NaN NaN 1 NaN NaN NaN NaN NaN \n",
"\n",
" 2022-12 2023-01 2023-02 2023-03 2023-04 \n",
"0 26 22 8.0 10.0 2.0 \n",
"1 NaN NaN NaN NaN NaN \n",
"2 NaN NaN 1.0 1.0 NaN \n",
"3 NaN NaN NaN NaN NaN \n",
"4 NaN NaN NaN NaN NaN "
]
},
"execution_count": 156,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cust_data.head(5)"
]
},
{
"cell_type": "code",
"execution_count": 157,
"id": "720c2582-f382-4fe7-bfca-768c696302aa",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<div style=\"display:flex;flex-direction:row;justify-content:space-between;\">\n",
" <pre style=\"width: 100%; white-space: pre-wrap;\" id=\"99e754d9-60e7-400c-8728-3208219bc9ac\">\n",
"cust_data.fillna(0, inplace=True)\n",
"</pre>\n",
" <button style=\"height: fit-content;\" onclick=\"navigator.clipboard.writeText(JSON.parse(atob(`IlxuY3VzdF9kYXRhLmZpbGxuYSgwLCBpbnBsYWNlPVRydWUpXG4i`)))\">Copy</button>\n",
" </div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cust_data.sketch.howto(\"Convert all NaN values to 0\")"
]
},
{
"cell_type": "code",
"execution_count": 168,
"id": "d659966c-830c-4f68-aa2a-ff8beb460177",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"cust_data.fillna(0, inplace=True)"
]
},
{
"cell_type": "code",
"execution_count": 169,
"id": "30f91b34-32a1-41da-9303-2da779c6492f",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Organization</th>\n",
" <th>2022-01</th>\n",
" <th>2022-02</th>\n",
" <th>2022-03</th>\n",
" <th>2022-04</th>\n",
" <th>2022-05</th>\n",
" <th>2022-06</th>\n",
" <th>2022-07</th>\n",
" <th>2022-08</th>\n",
" <th>2022-09</th>\n",
" <th>2022-10</th>\n",
" <th>2022-11</th>\n",
" <th>2022-12</th>\n",
" <th>2023-01</th>\n",
" <th>2023-02</th>\n",
" <th>2023-03</th>\n",
" <th>2023-04</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Aquent</td>\n",
" <td>58</td>\n",
" <td>38</td>\n",
" <td>50</td>\n",
" <td>50</td>\n",
" <td>39</td>\n",
" <td>36</td>\n",
" <td>46</td>\n",
" <td>46</td>\n",
" <td>43.0</td>\n",
" <td>27.0</td>\n",
" <td>24.0</td>\n",
" <td>26</td>\n",
" <td>22</td>\n",
" <td>8.0</td>\n",
" <td>10.0</td>\n",
" <td>2.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>BioLife Solutions, Inc.</td>\n",
" <td>11</td>\n",
" <td>7</td>\n",
" <td>4</td>\n",
" <td>11</td>\n",
" <td>4</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>ZyXel Communications Inc</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>4</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>BrightLine Eating Solutions LLC</td>\n",
" <td>10362</td>\n",
" <td>7890</td>\n",
" <td>7272</td>\n",
" <td>8177</td>\n",
" <td>8468</td>\n",
" <td>7524</td>\n",
" <td>8509</td>\n",
" <td>5638</td>\n",
" <td>581.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Casio America Inc</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Organization 2022-01 2022-02 2022-03 2022-04 2022-05 \n",
"0 Aquent 58 38 50 50 39 \\\n",
"1 BioLife Solutions, Inc. 11 7 4 11 4 \n",
"2 ZyXel Communications Inc 1 1 2 1 2 \n",
"3 BrightLine Eating Solutions LLC 10362 7890 7272 8177 8468 \n",
"4 Casio America Inc 0 0 0 0 0 \n",
"\n",
" 2022-06 2022-07 2022-08 2022-09 2022-10 2022-11 2022-12 2023-01 2023-02 \n",
"0 36 46 46 43.0 27.0 24.0 26 22 8.0 \\\n",
"1 0 0 0 0.0 0.0 0.0 0 0 0.0 \n",
"2 4 2 2 1.0 0.0 0.0 0 0 1.0 \n",
"3 7524 8509 5638 581.0 0.0 0.0 0 0 0.0 \n",
"4 1 0 0 0.0 0.0 0.0 0 0 0.0 \n",
"\n",
" 2023-03 2023-04 \n",
"0 10.0 2.0 \n",
"1 0.0 0.0 \n",
"2 1.0 0.0 \n",
"3 0.0 0.0 \n",
"4 0.0 0.0 "
]
},
"execution_count": 169,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cust_data.head(5)"
]
},
{
"cell_type": "code",
"execution_count": 160,
"id": "09aa7041-ade3-43a5-b7f2-477f1dd734f1",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<div style=\"display:flex;flex-direction:row;justify-content:space-between;\">\n",
" <pre style=\"width: 100%; white-space: pre-wrap;\" id=\"a1d0e0af-9a67-4883-9d7f-9ab80ac39bb1\">\n",
"# Remove the OrgID and Churn Date columns\n",
"cust_data = cust_data.drop(columns=['OrgID', 'Churn Date'])\n",
"</pre>\n",
" <button style=\"height: fit-content;\" onclick=\"navigator.clipboard.writeText(JSON.parse(atob(`IlxuIyBSZW1vdmUgdGhlIE9yZ0lEIGFuZCBDaHVybiBEYXRlIGNvbHVtbnNcbmN1c3RfZGF0YSA9IGN1c3RfZGF0YS5kcm9wKGNvbHVtbnM9WydPcmdJRCcsICdDaHVybiBEYXRlJ10pXG4i`)))\">Copy</button>\n",
" </div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cust_data.sketch.howto(\"Remove the OrgID and Churn Date columns\")"
]
},
{
"cell_type": "code",
"execution_count": 173,
"id": "8d6d511c-1ee9-45e0-9f39-a7df08dfe5d4",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Organization</th>\n",
" <th>2022-01</th>\n",
" <th>2022-02</th>\n",
" <th>2022-03</th>\n",
" <th>2022-04</th>\n",
" <th>2022-05</th>\n",
" <th>2022-06</th>\n",
" <th>2022-07</th>\n",
" <th>2022-08</th>\n",
" <th>2022-09</th>\n",
" <th>2022-10</th>\n",
" <th>2022-11</th>\n",
" <th>2022-12</th>\n",
" <th>2023-01</th>\n",
" <th>2023-02</th>\n",
" <th>2023-03</th>\n",
" <th>2023-04</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Aquent</td>\n",
" <td>58</td>\n",
" <td>38</td>\n",
" <td>50</td>\n",
" <td>50</td>\n",
" <td>39</td>\n",
" <td>36</td>\n",
" <td>46</td>\n",
" <td>46</td>\n",
" <td>43.0</td>\n",
" <td>27.0</td>\n",
" <td>24.0</td>\n",
" <td>26</td>\n",
" <td>22</td>\n",
" <td>8.0</td>\n",
" <td>10.0</td>\n",
" <td>2.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>BioLife Solutions, Inc.</td>\n",
" <td>11</td>\n",
" <td>7</td>\n",
" <td>4</td>\n",
" <td>11</td>\n",
" <td>4</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>ZyXel Communications Inc</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>4</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>BrightLine Eating Solutions LLC</td>\n",
" <td>10362</td>\n",
" <td>7890</td>\n",
" <td>7272</td>\n",
" <td>8177</td>\n",
" <td>8468</td>\n",
" <td>7524</td>\n",
" <td>8509</td>\n",
" <td>5638</td>\n",
" <td>581.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Casio America Inc</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>Riviera Partners LLC</td>\n",
" <td>81</td>\n",
" <td>19</td>\n",
" <td>51</td>\n",
" <td>26</td>\n",
" <td>26</td>\n",
" <td>32</td>\n",
" <td>79</td>\n",
" <td>68</td>\n",
" <td>35.0</td>\n",
" <td>23.0</td>\n",
" <td>33.0</td>\n",
" <td>25</td>\n",
" <td>75</td>\n",
" <td>71.0</td>\n",
" <td>29.0</td>\n",
" <td>4.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>Viveve</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>19</td>\n",
" <td>3</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>connectRN Inc.</td>\n",
" <td>386</td>\n",
" <td>378</td>\n",
" <td>396</td>\n",
" <td>732</td>\n",
" <td>947</td>\n",
" <td>762</td>\n",
" <td>1203</td>\n",
" <td>889</td>\n",
" <td>438.0</td>\n",
" <td>178.0</td>\n",
" <td>115.0</td>\n",
" <td>214</td>\n",
" <td>92</td>\n",
" <td>165.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>Hammer Nutrition</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>7</td>\n",
" <td>5</td>\n",
" <td>4</td>\n",
" <td>5</td>\n",
" <td>6.0</td>\n",
" <td>6.0</td>\n",
" <td>0.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>National Campus and Community Radio Association</td>\n",
" <td>63</td>\n",
" <td>15</td>\n",
" <td>10</td>\n",
" <td>4</td>\n",
" <td>8</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>0</td>\n",
" <td>4.0</td>\n",
" <td>4.0</td>\n",
" <td>6.0</td>\n",
" <td>5</td>\n",
" <td>5</td>\n",
" <td>2.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>Portnoy, Messinger, Pearl &amp; Associates, Inc.</td>\n",
" <td>28</td>\n",
" <td>27</td>\n",
" <td>79</td>\n",
" <td>17</td>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>8</td>\n",
" <td>0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>Safari Energy</td>\n",
" <td>2</td>\n",
" <td>37</td>\n",
" <td>19</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>38</td>\n",
" <td>24</td>\n",
" <td>6</td>\n",
" <td>21.0</td>\n",
" <td>35.0</td>\n",
" <td>10.0</td>\n",
" <td>7</td>\n",
" <td>1</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>Starwood Pet Travel</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>4</td>\n",
" <td>22</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>7</td>\n",
" <td>0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>2</td>\n",
" <td>0</td>\n",
" <td>2.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>Trax Technology Solutions Pte Ltd</td>\n",
" <td>381</td>\n",
" <td>677</td>\n",
" <td>583</td>\n",
" <td>671</td>\n",
" <td>515</td>\n",
" <td>380</td>\n",
" <td>181</td>\n",
" <td>449</td>\n",
" <td>12.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>Uber London Limited (POOL)</td>\n",
" <td>721</td>\n",
" <td>775</td>\n",
" <td>825</td>\n",
" <td>606</td>\n",
" <td>578</td>\n",
" <td>501</td>\n",
" <td>497</td>\n",
" <td>543</td>\n",
" <td>628.0</td>\n",
" <td>505.0</td>\n",
" <td>650.0</td>\n",
" <td>1,270</td>\n",
" <td>1,957</td>\n",
" <td>190.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Organization 2022-01 2022-02 2022-03 \n",
"0 Aquent 58 38 50 \\\n",
"1 BioLife Solutions, Inc. 11 7 4 \n",
"2 ZyXel Communications Inc 1 1 2 \n",
"3 BrightLine Eating Solutions LLC 10362 7890 7272 \n",
"4 Casio America Inc 0 0 0 \n",
"5 Riviera Partners LLC 81 19 51 \n",
"6 Viveve 0 0 0 \n",
"7 connectRN Inc. 386 378 396 \n",
"8 Hammer Nutrition 0 1 1 \n",
"9 National Campus and Community Radio Association 63 15 10 \n",
"10 Portnoy, Messinger, Pearl & Associates, Inc. 28 27 79 \n",
"11 Safari Energy 2 37 19 \n",
"12 Starwood Pet Travel 0 1 4 \n",
"13 Trax Technology Solutions Pte Ltd 381 677 583 \n",
"14 Uber London Limited (POOL) 721 775 825 \n",
"\n",
" 2022-04 2022-05 2022-06 2022-07 2022-08 2022-09 2022-10 2022-11 2022-12 \n",
"0 50 39 36 46 46 43.0 27.0 24.0 26 \\\n",
"1 11 4 0 0 0 0.0 0.0 0.0 0 \n",
"2 1 2 4 2 2 1.0 0.0 0.0 0 \n",
"3 8177 8468 7524 8509 5638 581.0 0.0 0.0 0 \n",
"4 0 0 1 0 0 0.0 0.0 0.0 0 \n",
"5 26 26 32 79 68 35.0 23.0 33.0 25 \n",
"6 0 0 4 1 0 0.0 0.0 0.0 19 \n",
"7 732 947 762 1203 889 438.0 178.0 115.0 214 \n",
"8 2 7 5 4 5 6.0 6.0 0.0 0 \n",
"9 4 8 2 3 0 4.0 4.0 6.0 5 \n",
"10 17 1 3 8 0 1.0 0.0 1.0 1 \n",
"11 2 1 38 24 6 21.0 35.0 10.0 7 \n",
"12 22 2 1 7 0 0.0 0.0 0.0 2 \n",
"13 671 515 380 181 449 12.0 0.0 1.0 1 \n",
"14 606 578 501 497 543 628.0 505.0 650.0 1,270 \n",
"\n",
" 2023-01 2023-02 2023-03 2023-04 \n",
"0 22 8.0 10.0 2.0 \n",
"1 0 0.0 0.0 0.0 \n",
"2 0 1.0 1.0 0.0 \n",
"3 0 0.0 0.0 0.0 \n",
"4 0 0.0 0.0 0.0 \n",
"5 75 71.0 29.0 4.0 \n",
"6 3 0.0 0.0 0.0 \n",
"7 92 165.0 0.0 0.0 \n",
"8 0 0.0 0.0 0.0 \n",
"9 5 2.0 0.0 0.0 \n",
"10 2 0.0 0.0 0.0 \n",
"11 1 0.0 0.0 0.0 \n",
"12 0 2.0 0.0 0.0 \n",
"13 1 0.0 0.0 0.0 \n",
"14 1,957 190.0 0.0 0.0 "
]
},
"execution_count": 173,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cust_data.head(15)"
]
},
{
"cell_type": "code",
"execution_count": 176,
"id": "c13baa2d-428c-4ff4-a2f6-12737819fb9f",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<div style=\"display:flex;flex-direction:row;justify-content:space-between;\">\n",
" <pre style=\"width: 100%; white-space: pre-wrap;\" id=\"9569b033-0def-4a83-b056-19fea217d1da\">\n",
"# Convert index row, columns 1-17 value to datetime\n",
"cust_data.columns = pd.to_datetime(cust_data.columns)\n",
"</pre>\n",
" <button style=\"height: fit-content;\" onclick=\"navigator.clipboard.writeText(JSON.parse(atob(`IlxuIyBDb252ZXJ0IGluZGV4IHJvdywgY29sdW1ucyAxLTE3IHZhbHVlIHRvIGRhdGV0aW1lXG5jdXN0X2RhdGEuY29sdW1ucyA9IHBkLnRvX2RhdGV0aW1lKGN1c3RfZGF0YS5jb2x1bW5zKVxuIg==`)))\">Copy</button>\n",
" </div>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cust_data.sketch.howto(\"Convert index row, columns 1-17 value to datetime\")"
]
},
{
"cell_type": "code",
"execution_count": 179,
"id": "c229b344-94c8-4ab1-aa8d-1e15d6dc12bc",
"metadata": {
"tags": []
},
"outputs": [
{
"ename": "ValueError",
"evalue": "Length mismatch: Expected axis has 17 elements, new values have 15 elements",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[179], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# Convert index row, columns 1-17 value to datetime\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[43mcust_data\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcolumns\u001b[49m \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mto_datetime(cust_data\u001b[38;5;241m.\u001b[39mcolumns[\u001b[38;5;241m1\u001b[39m:\u001b[38;5;241m16\u001b[39m])\n",
"File \u001b[0;32m~/.pyenv/versions/3.11.1/envs/jupyter/lib/python3.11/site-packages/pandas/core/generic.py:6002\u001b[0m, in \u001b[0;36mNDFrame.__setattr__\u001b[0;34m(self, name, value)\u001b[0m\n\u001b[1;32m 6000\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 6001\u001b[0m \u001b[38;5;28mobject\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__getattribute__\u001b[39m(\u001b[38;5;28mself\u001b[39m, name)\n\u001b[0;32m-> 6002\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mobject\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;21;43m__setattr__\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvalue\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 6003\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m:\n\u001b[1;32m 6004\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n",
"File \u001b[0;32m~/.pyenv/versions/3.11.1/envs/jupyter/lib/python3.11/site-packages/pandas/_libs/properties.pyx:69\u001b[0m, in \u001b[0;36mpandas._libs.properties.AxisProperty.__set__\u001b[0;34m()\u001b[0m\n",
"File \u001b[0;32m~/.pyenv/versions/3.11.1/envs/jupyter/lib/python3.11/site-packages/pandas/core/generic.py:730\u001b[0m, in \u001b[0;36mNDFrame._set_axis\u001b[0;34m(self, axis, labels)\u001b[0m\n\u001b[1;32m 725\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 726\u001b[0m \u001b[38;5;124;03mThis is called from the cython code when we set the `index` attribute\u001b[39;00m\n\u001b[1;32m 727\u001b[0m \u001b[38;5;124;03mdirectly, e.g. `series.index = [1, 2, 3]`.\u001b[39;00m\n\u001b[1;32m 728\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 729\u001b[0m labels \u001b[38;5;241m=\u001b[39m ensure_index(labels)\n\u001b[0;32m--> 730\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_mgr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mset_axis\u001b[49m\u001b[43m(\u001b[49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlabels\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 731\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_clear_item_cache()\n",
"File \u001b[0;32m~/.pyenv/versions/3.11.1/envs/jupyter/lib/python3.11/site-packages/pandas/core/internals/managers.py:225\u001b[0m, in \u001b[0;36mBaseBlockManager.set_axis\u001b[0;34m(self, axis, new_labels)\u001b[0m\n\u001b[1;32m 223\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mset_axis\u001b[39m(\u001b[38;5;28mself\u001b[39m, axis: AxisInt, new_labels: Index) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 224\u001b[0m \u001b[38;5;66;03m# Caller is responsible for ensuring we have an Index object.\u001b[39;00m\n\u001b[0;32m--> 225\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_validate_set_axis\u001b[49m\u001b[43m(\u001b[49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnew_labels\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 226\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maxes[axis] \u001b[38;5;241m=\u001b[39m new_labels\n",
"File \u001b[0;32m~/.pyenv/versions/3.11.1/envs/jupyter/lib/python3.11/site-packages/pandas/core/internals/base.py:70\u001b[0m, in \u001b[0;36mDataManager._validate_set_axis\u001b[0;34m(self, axis, new_labels)\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n\u001b[1;32m 69\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m new_len \u001b[38;5;241m!=\u001b[39m old_len:\n\u001b[0;32m---> 70\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 71\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mLength mismatch: Expected axis has \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mold_len\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m elements, new \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 72\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mvalues have \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mnew_len\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m elements\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 73\u001b[0m )\n",
"\u001b[0;31mValueError\u001b[0m: Length mismatch: Expected axis has 17 elements, new values have 15 elements"
]
}
],
"source": [
"# Convert index row, columns 1-17 value to datetime\n",
"cust_data.columns = pd.to_datetime(cust_data.columns[1:16])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c574a86b-67a8-4cdd-9cbd-b7461c2f1c8c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,524 +0,0 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd \n",
"import numpy as np \n",
"import seaborn as sns \n",
"import matplotlib.pylab as plt \n",
"import sketch\n",
"#plt.style.use('ggplot')"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"School Name object\n",
"School Uuid object\n",
"Customer Id object\n",
"Path object\n",
"Apr 7 - 13 int64\n",
"dtype: object"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd.set_option('display.max_rows', 100)\n",
"pageviews = pd.read_csv(\"/Users/normrasmussen/Documents/Work/Data/GraphQuery (4).csv\", index_col=None)\n",
"pageviews.dtypes"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>academy</th>\n",
" <th>academy_id</th>\n",
" <th>org_id</th>\n",
" <th>path</th>\n",
" <th>apr_week</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Compass Academy</td>\n",
" <td>dc62bd23-e093-49ff-9f85-b8e3d6dc9e34</td>\n",
" <td>49efbc2d-004a-4130-819a-2f5cdd59413f</td>\n",
" <td>/people</td>\n",
" <td>356</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>CHEK Institute</td>\n",
" <td>c2adf18f-9247-403f-9914-f9ce7d412d17</td>\n",
" <td>4d7e5559-a90f-4c1c-9de7-88d4495ae76a</td>\n",
" <td>/people</td>\n",
" <td>288</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>GenTech Associates Academy</td>\n",
" <td>d38a8181-f864-40cd-91da-b47b05f8bf69</td>\n",
" <td>8fe4e045-0882-4a7d-a695-1477f1aa32d7</td>\n",
" <td>/people</td>\n",
" <td>137</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>CTAA&amp;#39;s School</td>\n",
" <td>e79c2971-f7dd-4f7b-93b3-c3192c00824f</td>\n",
" <td>677b83a3-20d8-4073-9cfb-6a28c6d53b92</td>\n",
" <td>/people</td>\n",
" <td>136</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Solo Internal Training</td>\n",
" <td>72047a94-38c4-460e-90e2-2a3df5096852</td>\n",
" <td>c05d6a25-cc80-447a-9b85-7b222ad9e4fd</td>\n",
" <td>/media</td>\n",
" <td>129</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>118</th>\n",
" <td>Lighthouse by LJ Hooker Group</td>\n",
" <td>cb56a39f-b6a1-4c0a-893f-9e0e93fe6c24</td>\n",
" <td>7ccf4a79-c896-4865-95e4-dfe134119943</td>\n",
" <td>/instructor_led_trainings</td>\n",
" <td>32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>119</th>\n",
" <td>Mark43 University</td>\n",
" <td>85e2acae-6a0b-4f1c-a3e1-dd113218321d</td>\n",
" <td>ea5c9708-73f9-4905-a759-7b68d0128206</td>\n",
" <td>/courses</td>\n",
" <td>32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>120</th>\n",
" <td>Mizuno Academy</td>\n",
" <td>f61cd40c-6cbf-41b3-a797-78b923137c23</td>\n",
" <td>b99abead-4af0-487d-b8a4-d77b2c8dded4</td>\n",
" <td>/communications/emails/broadcast</td>\n",
" <td>32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>121</th>\n",
" <td>Capstone Scholars Program</td>\n",
" <td>66f38581-27d9-4d9d-8134-edd09c87940a</td>\n",
" <td>abbe2201-8500-4067-aeaf-73fa99824784</td>\n",
" <td>/people</td>\n",
" <td>32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>122</th>\n",
" <td>Garrett Virtual Academy</td>\n",
" <td>4f211014-bf83-4c8d-8779-d743777ca8cf</td>\n",
" <td>26370510-3f8a-4d3a-9808-3d7ba2388e97</td>\n",
" <td>/people/invite</td>\n",
" <td>32</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>123 rows × 5 columns</p>\n",
"</div>"
],
"text/plain": [
" academy academy_id \n",
"0 Compass Academy dc62bd23-e093-49ff-9f85-b8e3d6dc9e34 \\\n",
"1 CHEK Institute c2adf18f-9247-403f-9914-f9ce7d412d17 \n",
"2 GenTech Associates Academy d38a8181-f864-40cd-91da-b47b05f8bf69 \n",
"3 CTAA&#39;s School e79c2971-f7dd-4f7b-93b3-c3192c00824f \n",
"4 Solo Internal Training 72047a94-38c4-460e-90e2-2a3df5096852 \n",
".. ... ... \n",
"118 Lighthouse by LJ Hooker Group cb56a39f-b6a1-4c0a-893f-9e0e93fe6c24 \n",
"119 Mark43 University 85e2acae-6a0b-4f1c-a3e1-dd113218321d \n",
"120 Mizuno Academy f61cd40c-6cbf-41b3-a797-78b923137c23 \n",
"121 Capstone Scholars Program 66f38581-27d9-4d9d-8134-edd09c87940a \n",
"122 Garrett Virtual Academy 4f211014-bf83-4c8d-8779-d743777ca8cf \n",
"\n",
" org_id path \n",
"0 49efbc2d-004a-4130-819a-2f5cdd59413f /people \\\n",
"1 4d7e5559-a90f-4c1c-9de7-88d4495ae76a /people \n",
"2 8fe4e045-0882-4a7d-a695-1477f1aa32d7 /people \n",
"3 677b83a3-20d8-4073-9cfb-6a28c6d53b92 /people \n",
"4 c05d6a25-cc80-447a-9b85-7b222ad9e4fd /media \n",
".. ... ... \n",
"118 7ccf4a79-c896-4865-95e4-dfe134119943 /instructor_led_trainings \n",
"119 ea5c9708-73f9-4905-a759-7b68d0128206 /courses \n",
"120 b99abead-4af0-487d-b8a4-d77b2c8dded4 /communications/emails/broadcast \n",
"121 abbe2201-8500-4067-aeaf-73fa99824784 /people \n",
"122 26370510-3f8a-4d3a-9808-3d7ba2388e97 /people/invite \n",
"\n",
" apr_week \n",
"0 356 \n",
"1 288 \n",
"2 137 \n",
"3 136 \n",
"4 129 \n",
".. ... \n",
"118 32 \n",
"119 32 \n",
"120 32 \n",
"121 32 \n",
"122 32 \n",
"\n",
"[123 rows x 5 columns]"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pageviews = pageviews.rename(columns={\n",
" 'School Name':'academy',\n",
" 'School Uuid':'academy_id',\n",
" 'Customer Id':'org_id',\n",
" 'Path':'path',\n",
" 'Apr 7 - 13': 'apr_week',\n",
"})\n",
"pageviews.head(123)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"# pageviews.apr_week = pageviews.apr_week.astype(int)\n",
"# pageviews.academy_id = pageviews.academy_id.astype('category').cat.codes\n",
"# pageviews.org_id = pageviews.org_id.astype('category').cat.codes\n",
"# pageviews['academy']=pageviews['academy'].astype('category').cat.codes\n",
"# pageviews['path']=pageviews['path'].astype('category').cat.codes\n",
"# pageviews.plot(kind='scatter', x='apr_week', y='path')"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>apr_week</th>\n",
" </tr>\n",
" <tr>\n",
" <th>academy</th>\n",
" <th>path</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">Vivvix University for Ad Intel</th>\n",
" <th>/account_links</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/courses</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"8\" valign=\"top\">'@properties Academy</th>\n",
" <th>/account_links</th>\n",
" <td>8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/courses</th>\n",
" <td>11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups</th>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/courses</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/edit</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/memberships</th>\n",
" <td>8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/memberships/new</th>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/instructor_led_trainings</th>\n",
" <td>11</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" apr_week\n",
"academy path \n",
" Vivvix University for Ad Intel /account_links 1\n",
" /courses 1\n",
"'@properties Academy /account_links 8\n",
" /courses 11\n",
" /groups 4\n",
" /groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/co... 1\n",
" /groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/edit 1\n",
" /groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/me... 8\n",
" /groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/me... 3\n",
" /instructor_led_trainings 11"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#pageviews = pageviews.groupby(['academy', 'path']).agg({'apr_week':'sum'})\n",
"#pageviews.head(10)"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>apr_week</th>\n",
" </tr>\n",
" <tr>\n",
" <th>academy</th>\n",
" <th>path</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">Vivvix University for Ad Intel</th>\n",
" <th>/account_links</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/courses</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"8\" valign=\"top\">'@properties Academy</th>\n",
" <th>/account_links</th>\n",
" <td>8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/courses</th>\n",
" <td>11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups</th>\n",
" <td>4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/courses</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/edit</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/memberships</th>\n",
" <td>8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/memberships/new</th>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>/instructor_led_trainings</th>\n",
" <td>11</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" apr_week\n",
"academy path \n",
" Vivvix University for Ad Intel /account_links 1\n",
" /courses 1\n",
"'@properties Academy /account_links 8\n",
" /courses 11\n",
" /groups 4\n",
" /groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/co... 1\n",
" /groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/edit 1\n",
" /groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/me... 8\n",
" /groups/2a09819b-a19a-4e87-91c6-8b50ee3c46f8/me... 3\n",
" /instructor_led_trainings 11"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pageviews.reset_index\n",
"pageviews.head(10)"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0 True\n",
"1 True\n",
"2 True\n",
"3 True\n",
"4 False\n",
" ... \n",
"13861 True\n",
"13862 True\n",
"13863 False\n",
"13864 False\n",
"13865 False\n",
"Name: path, Length: 13866, dtype: bool"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"startswith_list = ('/courses', '/people', 'learning_paths', '/instructor_led_trainings', '/preview', '/groups', '/account_links')\n",
"#for root in startswith_list:\n",
"# pageviews.path.str.startswith(root, na=False)\n",
" #pageviews['root'] = pageviews.path.apply(lambda x: root if pageviews.path.str.startswith(root, na=False) else 'None')\n",
"\n",
"pageviews.path.str.startswith(startswith_list)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "jupyter",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.1"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}

File diff suppressed because it is too large Load Diff