-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtranspose-tupper.py
32 lines (32 loc) · 5.51 KB
/
transpose-tupper.py
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
# Python Select Interpreter must match interpreter instance where modules were installed
# may need to delete old Python extension folder
import pandas as pd
import sys
# Define the bit sequence as a string
bit_sequence = "111000011000000010001000010000001000001000100000010000001001000000100000001010000000100000001100000000100000001000000000000000000000000000000000000000000000000000000000001100011000000000100101001000000010000100001000000100001000010000001000000000100000001000000001000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000001001000000111111111110000001100000100100000000100001001000000000110010000000000000010100000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110000000000000011100000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000000000000001011100000000000010000111000000000100000001110000001000000000100000010000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000010000000000000000100000011111111111000000110000000010000000100000000100000001000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111000000000000110011000000000001000010000000000010000100000000000110011000000000000111100000000000000000000000000000000000000000000000000000000000000000000000000000000000111000011000000010001000010000001000001000100000010000001001000000100000001010000000100000001100000000100000001000000000000000000000000000000000000000000000000000000000000000000000000000011100001100000001000100001000000100000100010000001000000100100000010000000101000000010000000110000000010000000100000000000000000000000000000000000000000000000000000000000000000001000000000000000010000000000000000100000011111111111000000110000000010000000100000000100000001000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000001111110000000000010000011110000000100000111100000000001111000000000000110000000000000000111100000000001000000111000000010000111110000000111110000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000001000000000000000010000001111111111100000011000000001000000010000000010000000100000000100000000000000000000000000000000000000000000000000000000000000000000000000001111111000000000100000001000000010000000001000000100000000010000001000000000100000001000000010000000001111111000000000000000000000000000000000000000000000000000000000000000000000000000000000011100000000100001000100000001000100000100000010001000001000000100010000010000001000100000100000011111100001000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110000000000000011100000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111000000001000010001000000010001000001000000100010000010000001000100000100000010001000001000000111111000010000000000000001000000000000000000000000000000000000000000000000000000000000110001100000000010010100100000001000010000100000010000100001000000100000000010000000100000000100000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111000000000000110011000000000001000010000000000010000100000000000110011000000000000111100000000000000000000000000000000000000000000000000000000000000001100000000000000010111000000000000100001110000000001000000011100000010000000001000000100000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010010000001111111111100000011000001001000000001000010010000000001100100000000000000101000000000000000110000000000000000000000000000000000000000000000000000000000000100000000000000001111111111000000010000001100000000100000110000000000000110000000000000110000010000000110000000100000001111111111000000010000000010000000000000000000000000000000000001000000000000000010000000000000000100000000000000001"
# Initialize an empty list to store the chunks
chunks = []
for i in range(0, len(bit_sequence), 17):
chunks.append(bit_sequence[i:i+17])
df = pd.DataFrame()
i=0
for chunk in chunks: # chunk is a 17 char string
j=0
for bit in chunk:
if bit == '0':
display_bit=' '
elif bit == '1':
display_bit='*'
df.at[j,(270-i)]=display_bit
j=j+1
i=i+1
df = df.sort_index(axis=1, ascending=True)
#csv=df.to_csv(sys.stdout, index=False, header=False, sep=',')
csv=df.to_csv(index=False, header=False, sep=',')
#df.to_csv(path_or_buf='C:\\Users\\Zeattle people\\Documents\\output.csv', index=False, header=False, sep=',')
#print(type(csv))
csv=csv.replace(",","")
output_file = "C:\\temp\\output.csv"
with open(output_file, "w", newline='\n') as f:
f.write(csv)
f.close()