Skip to content

Commit 1a3e23a

Browse files
author
Tanya Branagan
committed
Add all Python code to repo for backup
0 parents  commit 1a3e23a

File tree

174 files changed

+142270
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+142270
-0
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/venv

Diff for: customers

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 15145ebc3301f270eaf5497c1ffe553334c506fa

Diff for: generators/techcrunch-generator.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import statistics
2+
3+
file_name = 'techcrunch.csv'
4+
5+
lines = (line for line in open(file_name))
6+
list_line = (s.rstrip().split(',') for s in lines)
7+
8+
cols = next(list_line)
9+
company_dicts = (dict(zip(cols, data)) for data in list_line)
10+
11+
funding = (
12+
int(company_dict['raisedAmt'])
13+
for company_dict in company_dicts
14+
if company_dict['round'] == 'a'
15+
)
16+
17+
average = statistics.mean(funding)
18+
print(f"Average series A fundraising: ${average}")
19+
20+
# total_series_a = sum(funding)
21+
# print(f"Total series A fundraising: ${total_series_a}")
22+
23+

Diff for: generators/techcrunch.csv

+1,461
Large diffs are not rendered by default.

Diff for: graphs/.history/.ipynb_checkpoints/test_20200922151213.py

Whitespace-only changes.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# tanya, noël
2+
chess_scores = [
3+
(65.6, 96.8),
4+
(18.3, 99.1),
5+
(92.2, 99.2),
6+
(24.5, 96.2),
7+
(66.8, 97.6),
8+
(14.1, 96.2),
9+
(18.6, 99),
10+
(15.5, 98.4),
11+
(15.6, 99.1),
12+
(45.8, 98.8),
13+
(89.7, 73.6),
14+
(6.6, 39.6),
15+
(50.4, 80.2),
16+
(43.4, 81.9),
17+
(11.1, 51.4),
18+
(76.4, 97.2),
19+
(15.7, 96.1),
20+
(2.2, 59.4),
21+
(8.3, 79.5),
22+
(15.7, 45.6)
23+
]
24+
25+
tanya_scores, noel_scores = [x[0], x[1] for x in chess scores]

Diff for: graphs/.history/test_20200922151348.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# tanya, noël
2+
chess_scores = [
3+
(65.6, 96.8),
4+
(18.3, 99.1),
5+
(92.2, 99.2),
6+
(24.5, 96.2),
7+
(66.8, 97.6),
8+
(14.1, 96.2),
9+
(18.6, 99),
10+
(15.5, 98.4),
11+
(15.6, 99.1),
12+
(45.8, 98.8),
13+
(89.7, 73.6),
14+
(6.6, 39.6),
15+
(50.4, 80.2),
16+
(43.4, 81.9),
17+
(11.1, 51.4),
18+
(76.4, 97.2),
19+
(15.7, 96.1),
20+
(2.2, 59.4),
21+
(8.3, 79.5),
22+
(15.7, 45.6)
23+
]
24+
25+
tanya_scores, noel_scores = [x[0], x[1] for x in chess scores]

Diff for: graphs/.history/test_20200922152057.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# tanya, noël
2+
chess_scores = [
3+
(65.6, 96.8),
4+
(18.3, 99.1),
5+
(92.2, 99.2),
6+
(24.5, 96.2),
7+
(66.8, 97.6),
8+
(14.1, 96.2),
9+
(18.6, 99),
10+
(15.5, 98.4),
11+
(15.6, 99.1),
12+
(45.8, 98.8),
13+
(89.7, 73.6),
14+
(6.6, 39.6),
15+
(50.4, 80.2),
16+
(43.4, 81.9),
17+
(11.1, 51.4),
18+
(76.4, 97.2),
19+
(15.7, 96.1),
20+
(2.2, 59.4),
21+
(8.3, 79.5),
22+
(15.7, 45.6)
23+
]
24+
25+
tanya_scores, noel_scores = chess_scores
26+
print(tanya_scores, noel_scores)

Diff for: graphs/.history/test_20200922152229.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# tanya, noël
2+
chess_scores = [
3+
(65.6, 96.8),
4+
(18.3, 99.1),
5+
(92.2, 99.2),
6+
(24.5, 96.2),
7+
(66.8, 97.6),
8+
(14.1, 96.2),
9+
(18.6, 99),
10+
(15.5, 98.4),
11+
(15.6, 99.1),
12+
(45.8, 98.8),
13+
(89.7, 73.6),
14+
(6.6, 39.6),
15+
(50.4, 80.2),
16+
(43.4, 81.9),
17+
(11.1, 51.4),
18+
(76.4, 97.2),
19+
(15.7, 96.1),
20+
(2.2, 59.4),
21+
(8.3, 79.5),
22+
(15.7, 45.6)
23+
]
24+
25+
# tanya_scores, noel_scores = [x[0], x[1] for x in chess_scores]
26+
# print(tanya_scores, noel_scores)
27+
print([x[0], x[1] for x in chess_scores])

Diff for: graphs/.history/test_20200922152518.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# tanya, noël
2+
chess_scores = [
3+
(65.6, 96.8),
4+
(18.3, 99.1),
5+
(92.2, 99.2),
6+
(24.5, 96.2),
7+
(66.8, 97.6),
8+
(14.1, 96.2),
9+
(18.6, 99),
10+
(15.5, 98.4),
11+
(15.6, 99.1),
12+
(45.8, 98.8),
13+
(89.7, 73.6),
14+
(6.6, 39.6),
15+
(50.4, 80.2),
16+
(43.4, 81.9),
17+
(11.1, 51.4),
18+
(76.4, 97.2),
19+
(15.7, 96.1),
20+
(2.2, 59.4),
21+
(8.3, 79.5),
22+
(15.7, 45.6)
23+
]
24+
25+
# tanya_scores, noel_scores = [x[0], x[1] for x in chess_scores]
26+
# print(tanya_scores, noel_scores)
27+
print([x[0] for x in chess_scores])

Diff for: graphs/.ipynb_checkpoints/Untitled-checkpoint.ipynb

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 2
6+
}

Diff for: graphs/Untitled.ipynb

+111
Large diffs are not rendered by default.

Diff for: graphs/test.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# tanya, noël
2+
chess_scores = [
3+
(65.6, 96.8),
4+
(18.3, 99.1),
5+
(92.2, 99.2),
6+
(24.5, 96.2),
7+
(66.8, 97.6),
8+
(14.1, 96.2),
9+
(18.6, 99),
10+
(15.5, 98.4),
11+
(15.6, 99.1),
12+
(45.8, 98.8),
13+
(89.7, 73.6),
14+
(6.6, 39.6),
15+
(50.4, 80.2),
16+
(43.4, 81.9),
17+
(11.1, 51.4),
18+
(76.4, 97.2),
19+
(15.7, 96.1),
20+
(2.2, 59.4),
21+
(8.3, 79.5),
22+
(15.7, 45.6)
23+
]
24+
25+
# tanya_scores, noel_scores = [x[0], x[1] for x in chess_scores]
26+
# print(tanya_scores, noel_scores)
27+
print([x[0] for x in chess_scores])

Diff for: little-guys/.history/bird_counter_20200821162710.py

Whitespace-only changes.

Diff for: little-guys/.history/bird_counter_20200821162712.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def migratoryBirds(arr):
2+
birds = {}
3+
bird_ids = []
4+
for bird in arr:
5+
if bird not in birds:
6+
birds[bird] = 1
7+
else:
8+
birds[bird] += 1
9+
for bird_id, num_sightings in birds.items():
10+
if num_sightings == max(birds.values()):
11+
bird_ids.append(bird_id)
12+
return min(bird_ids)

Diff for: little-guys/.history/birthday_chocolate_20200821152246.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def birthday(s, d, m):
2+
segments = []
3+
segment_count = 0
4+
for index in range(len(s)):
5+
segments.append(s[index:index + m])
6+
for segment in segments:
7+
if len(segment) == m and sum(segment) == d:
8+
segment_count += 1
9+
return segment_count
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
def birthday(s, d, m):
2+
segments = []
3+
segment_count = 0
4+
for index in range(len(s)):
5+
segments.append(s[index:index + m])
6+
for segment in segments:
7+
if len(segment) == m and sum(segment) == d:
8+
segment_count += 1
9+
return segment_count

Diff for: little-guys/.history/breaking_records_20200818225423.py

Whitespace-only changes.
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
def breakingRecords(scores):
2+
min_score = 100000000
3+
max_score = 0
4+
match = 0
5+
losses = 0
6+
wins = 0
7+
print(scores)
8+
for score in scores:
9+
if score < min_score:
10+
min_score = score
11+
if match > 0:
12+
losses += 1
13+
if score > max_score:
14+
max_score = score
15+
if match > 0:
16+
wins += 1
17+
match += 1
18+
return (wins, losses)

Diff for: little-guys/.history/create_all_pairs_20200820154323.py

Whitespace-only changes.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
for i in range(len(ar)):
2+
for j in ar[i + 1:]:
3+
num_list.append((ar[i], j))
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
num_list = []
2+
for i in range(len(ar)):
3+
for j in ar[i + 1:]:
4+
num_list.append((ar[i], j))
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ar = [1, 2, 6, 2, 6, 7, 4, 9]
2+
num_list = []
3+
4+
for i in range(len(ar)):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ar = [1, 2, 6, 2, 6, 7, 4, 9]
2+
num_list = []
3+
4+
for i in range(len(ar)):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
7+
print(num_list)
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ar = [1, 2, 6, 2, 6, 7, 4, 9]
2+
num_list = []
3+
4+
for i in range(len(ar)):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
7+
print(num_list)
8+
9+
10+
for idx, num in ar:
11+
for j in ar[idx + 1]:
12+
num_list.append((ar[i], j))
13+
print(num_list)
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ar = [1, 2, 6, 2, 6, 7, 4, 9]
2+
num_list = []
3+
4+
for i in range(len(ar)):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
7+
print(num_list)
8+
9+
10+
for idx, num in enumerate(ar):
11+
for j in ar[idx + 1]:
12+
num_list.append((ar[i], j))
13+
print(num_list)
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ar = [1, 2, 6, 2, 6, 7, 4, 9]
2+
num_list = []
3+
4+
for i in range(len(ar)):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
7+
print(num_list)
8+
9+
10+
for idx, num in enumerate(ar):
11+
for j in ar[idx + 1:]:
12+
num_list.append((ar[i], j))
13+
print(num_list)
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ar = [1, 2, 6, 2, 6, 7, 4, 9]
2+
num_list = []
3+
4+
for i in range(len(ar)):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
7+
print(num_list)
8+
9+
10+
for idx, num in enumerate(ar):
11+
for j in ar[idx + 1:]:
12+
num_list.append((ar[idx], j))
13+
print(num_list)
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ar = [1, 2, 6, 2, 6, 7, 4, 9]
2+
num_list = []
3+
4+
for i in range(len(ar)):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
7+
print(num_list)
8+
9+
10+
for idx, num in enumerate(ar):
11+
for jdx in ar[idx + 1:]:
12+
num_list.append((ar[idx], jdx))
13+
print(num_list)
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ar = [1, 2, 6, 2, 6, 7, 4, 9]
2+
num_list = []
3+
4+
for i in range(len(ar)):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
7+
print(num_list)
8+
9+
print()
10+
for idx, num in enumerate(ar):
11+
for jdx in ar[idx + 1:]:
12+
num_list.append((ar[idx], jdx))
13+
print(num_list)
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ar = [1, 2, 6, 2, 6, 7, 4, 9]
2+
num_list = []
3+
4+
for i in range(len(ar)):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
7+
print(num_list)

Diff for: little-guys/.history/divisible_sum_pairs_20200820154214.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def divisibleSumPairs(n, k, ar):
2+
count_pairs = 0
3+
num_list = []
4+
for i, num in enumerate(ar):
5+
for j in ar[i + 1:]:
6+
num_list.append((ar[i], j))
7+
for pair in num_list:
8+
print(sum(pair))
9+
if sum(pair) % k == 0:
10+
count_pairs += 1
11+
return count_pairs

0 commit comments

Comments
 (0)