Skip to content

Commit

Permalink
True north membership starts from May 2023. closes #58
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-strange committed Jun 24, 2024
1 parent 09f50c4 commit 4ccdcf8
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 38 deletions.
22 changes: 11 additions & 11 deletions pipelines/truenorth/analyse_members_list.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
" </tr>\n",
" <tr>\n",
" <th>unique</th>\n",
" <td>163</td>\n",
" <td>159</td>\n",
" <td>160</td>\n",
" <td>147</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
Expand All @@ -155,7 +155,7 @@
"count 245 245 \n",
"top 2024-06-20 00:00:00 2024-06-20 00:00:00 \n",
"freq 60.0 60.0 \n",
"unique 163 159 \n",
"unique 160 147 \n",
"\n",
" Do you feel the True North report identified the key challenges and opportunities facing the region? \\\n",
"count 185 \n",
Expand Down Expand Up @@ -359,8 +359,8 @@
" </tr>\n",
" <tr>\n",
" <th>unique</th>\n",
" <td>163</td>\n",
" <td>159</td>\n",
" <td>160</td>\n",
" <td>147</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
Expand Down Expand Up @@ -404,7 +404,7 @@
"count 245 245 \n",
"top 2024-06-20 00:00:00 2024-06-20 00:00:00 \n",
"freq 60.0 60.0 \n",
"unique 163 159 \n",
"unique 160 147 \n",
"top_percent_of_count 24.5 24.5 \n",
"\n",
" Do you feel the True North report identified the key challenges and opportunities facing the region? \\\n",
Expand Down Expand Up @@ -737,11 +737,11 @@
"3 Greater Manchester\n",
"4 West Yorkshire\n",
" ... \n",
"240 Blackburn\n",
"241 Chester\n",
"242 Helsby\n",
"243 NaN\n",
"244 Liverpool\n",
"240 Helsby\n",
"241 NaN\n",
"242 Liverpool\n",
"243 Merseyside\n",
"244 NaN\n",
"Name: City, Length: 245, dtype: object"
]
},
Expand Down
56 changes: 37 additions & 19 deletions pipelines/truenorth/clean_members_list.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/var/folders/5k/p_091y6n6rscp__0p77_ynv80000gn/T/ipykernel_77050/1262414977.py:1: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n",
"/var/folders/5k/p_091y6n6rscp__0p77_ynv80000gn/T/ipykernel_2002/1262414977.py:1: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n",
" data = pd.concat([hubspot_export, additional_members]).reset_index(drop=True)\n"
]
}
Expand All @@ -67,13 +67,31 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Add a \"last_updated\" column which uses the 'last activity date' column if it exists, otherwise the create date."
"The dates should all start in May 2023 or later."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"data['Create Date'] = pd.to_datetime(data['Create Date'])\n",
"start_date = pd.Timestamp('2023-05-01')\n",
"data.loc[data['Create Date'] < start_date, 'Create Date'] = start_date"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add a \"last_updated\" column which uses the 'last activity date' column if it exists, otherwise the create date."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -106,7 +124,7 @@
" 'last_updated']"
]
},
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -127,7 +145,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -149,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -173,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -184,7 +202,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -196,7 +214,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -217,7 +235,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -230,7 +248,7 @@
" 'no longer in position', 'Self employed'], dtype=object)"
]
},
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -241,7 +259,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -280,7 +298,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand All @@ -290,7 +308,7 @@
" 'no longer in position'], dtype=object)"
]
},
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -308,7 +326,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -329,7 +347,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -379,7 +397,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -403,7 +421,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -413,7 +431,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -429,7 +447,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
Expand Down
6 changes: 0 additions & 6 deletions src/overview/membership/_data/cumsum.csv
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
year,month_formatted,start_of_month,individuals,orgs
2022.16,2022-03,2022-03-01,21,21
2022.5,2022-07,2022-07-01,22,22
2022.58,2022-08,2022-08-01,25,25
2022.75,2022-10,2022-10-01,27,27
2022.91,2022-12,2022-12-01,31,31
2023.16,2023-03,2023-03-01,33,33
2023.33,2023-05,2023-05-01,37,37
2023.41,2023-06,2023-06-01,40,39
2023.49,2023-07,2023-07-01,48,46
Expand Down
7 changes: 5 additions & 2 deletions src/overview/membership/index.vto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nicesection: True North
<summary><h4>About this data</h4></summary>
<p>
The data below was generated from questionnaire responses. As the questionnaire has changed over time, some fields were incomplete for some responses.
All percentages are calculated as a fraction of the people who answered that question.
{{# You can read the details on <a href="true-north/membership/">how we processed this data</a>. #}}
</p>
</details>
Expand Down Expand Up @@ -39,8 +40,9 @@ nicesection: True North

<h3>Membership growth</h3>
<p>
The True North Network started in May 2023.
The chart below shows the cumulative number of members, and the cumulutive number of unique organisations,
in the True North network. In some months no one joined the network, so the data points are not evenly spaced.
who have joined the True North network since then.
</p>
{{ comp.oi.chart.line({ config: {
data: cumsum,
Expand Down Expand Up @@ -69,7 +71,8 @@ nicesection: True North

<h3>Membership sectors</h3>
<p>
This chart shows the frequency of words mentioned in the question "What sector do you operate in?".
This chart shows the frequency of words mentioned in the question "What sector do you operate in?". Note that "services" generally pairs
with other words, which explains its high frequency.
</p>
{{ comp.oi.chart.bar ({ config: {
data: sector_word_counts,
Expand Down

0 comments on commit 4ccdcf8

Please sign in to comment.