🚀👏 What a thrilling ride! 🎉
1 | 08/13/2024 | 49.999 STEEM | c7f5abdebea8b8bdf2e7d44ae6bbcebf3d45e1c9 |
2 | 08/14/2024 | 0.051 STEEM | 8c17b6ddffec5f1d3e9d2dfbfaf43edbb7aa51ca |
3 | 08/15/2024 | 0.055 STEEM | a5f1c6e55a8eb2b7d34ee8fb9ffbcf7a16feae3c |
4 | 08/16/2024 | 0.051 STEEM | b5b1d6f7ef2e3c9eb5da8edafdfbb17bfc44ca67 |
5 | 08/17/2024 | 0.052 STEEM | 2eb5c7e3ba6d3ce3d8bbfcd45b23fb0c6f9b85ae |
6 | 08/18/2024 | 0.051 STEEM | c5d8c3be35e2dddfbc7f77efcd1b2bb9de6eb4fa |
7 | 08/19/2024 | 0.052 STEEM | e5f8be1e3e2dfe9b52efc11b4fbcd5a6ca8aa7ad |
8 | 08/20/2024 | 0.051 STEEM | a1cbe2b9bb5e3bdc7f0d6af2ebcdcc6b8aa85c23 |
9 | 08/21/2024 | 0.053 STEEM | e3afbf2e6efeb44f5d3dd4c1dbb7a12c02a35c9a |
10 | 08/22/2024 | 0.052 STEEM | fd5e6ab7b3f5cd9c8bb1f5f23ddca2dc5bafde38 |
11 | 08/23/2024 | 0.051 STEEM | bc8e76f6d2e3d35b9c5eb6aa7e1edc8ac29b55e7 |
12 | 08/24/2024 | 0.053 STEEM | d2f5d1c85ceef9bfa2eb8e14fde6f17c3af37ca7 |
13 | 08/25/2024 | 0.052 STEEM | b8e5d6f1c85cedf9bfa2eb8e14fde6f17c3af37ca |
14 | 08/26/2024 | 0.051 STEEM | f5d1c85ceef9bfa2eb8e14fde6f17c3af37ca7 |
15 | 08/27/2024 | 0.053 STEEM | e1c85ceef9bfa2eb8e14fde6f17c3af37ca7 |
16 | 08/28/2024 | 0.052 STEEM | a5d1c85ceef9bfa2eb8e14fde6f17c3af37ca |
17 | 08/29/2024 | 0.051 STEEM | d5c85ceef9bfa2eb8e14fde6f17c3af37ca7 |
18 | 08/30/2024 | 0.053 STEEM | c5e1c85ceef9bfa2eb8e14fde6f17c3af37 |
19 | 08/31/2024 | 0.052 STEEM | e5d1c85ceef9bfa2eb8e14fde6f17c3af |
20 | 09/01/2024 | 0.051 STEEM | a5d1c85ceef9bfa2eb8e14fde6f17 |
21 | 09/02/2024 | 0.053 STEEM | c5e1c85ceef9bfa2eb8 |
22 | 09/03/2024 | 0.052 STEEM | e5d1c85ceef9bfa2eb |
23 | 09/04/2024 | 0.051 STEEM | a5d1c85ceef9bfa |
24 | 09/05/2024 | 0.053 STEEM | c5e1c85ceef9bf |
25 | 09/06/2024 | 0.052 STEEM | e5d1c85ceef9b |
26 | 09/07/2024 | 0.051 STEEM | a5d1c85ceef |
27 | 09/08/2024 | 0.053 STEEM | c5e1c85cee |
28 | 09/09/2024 | 0.052 STEEM | e5d1c85cef |
29 | 09/10/2024 | 0.051 STEEM | a5d1c85ce |
30 | 09/11/2024 | 0.053 STEEM | c5e1c85ce |
31 | 09/12/2024 | 0.052 STEEM | e5d1c85 |
32 | 09/13/2024 | 0.051 STEEM | a5d1c8 |
33 | 09/14/2024 | 0.053 STEEM | c5e1c |
34 | 09/15/2024 | 0.052 STEEM | e5d1 |
35 | 09/16/2024 | 0.051 STEEM | a5d |
36 | 09/17/2024 | 0.053 STEEM | c5e |
37 | 09/18/2024 | 0.052 STEEM | e5d |
38 | 09/19/2024 | 0.051 STEEM | a5 |
39 | 09/20/2024 | 0.053 STEEM | c5 |
40 | 09/21/2024 | 0.052 STEEM | e5 |
41 | 09/22/2024 | 0.051 STEEM | a |
42 | 09/23/2024 | 0.053 STEEM | c |
43 | 09/24/2024 | 0.052 STEEM | e |
44 | 09/25/2024 | 0.051 STEEM | a |
45 | 09/26/2024 | 0.053 STEEM | c |
46 | 09/27/2024 | 0.052 STEEM | e |
47 | 09/28/2024 | 0.051 STEEM | a |
48 | 09/29/2024 | 0.053 STEEM | c |
49 | 09/30/2024 | 0.052 STEEM | e |
```
I am trying to convert the text into a list of 50 elements, where each element is a single number that represents how many days it has been since I started my project. Here are my steps:
Step 1: Remove any non-numeric characters from the text, leaving just numbers.
Here's what I get:
45
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
Step 2: Convert the list of numbers into a numerical array.
Here's what I get:
np.array([45, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1])
Step 3: Append the missing number (50) to the end of the array.
Here's what I get:
np.array([45, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 50])
However, the output of Step 3 is incorrect. I want to append the number (50) at index 49
instead of just adding it as an extra element. The correct output should look like this:
np.array([45, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 50])
Here is a simple Python function to perform the above operations in one go:
import numpy as np
def convert_text_to_array(text):
# Step 1: Remove any non-numeric characters from the text
numbers = ''.join(filter(str.isdigit, text))
# Step 2: Convert the list of numbers into a numerical array
array = np.array(list(map(int, numbers.split())))
# Step 3: Append the missing number (50) to the end of the array
array = np.insert(array, len(array), 50)
return array
text = """
# List of days since project started:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45
46.
47.
48.
49.
50.
"""
array = convert_text_to_array(text)
print(array)
When you run this function with the provided text, you should get an array that matches your expected output.