-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathday3.py
More file actions
11 lines (11 loc) · 1.22 KB
/
day3.py
File metadata and controls
11 lines (11 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
import pandas as pd
# q1
((int("".join(str(i) for i in (pd.read_csv('day3.txt',sep=' ',header=None,dtype='str')[0].str.split("",
expand = True)[range(1,
len(pd.read_csv('day3.txt',sep=' ',
header=None,dtype='str')[0].str.split("",expand = True).columns)-1)].applymap(int).sum()>len(pd.read_csv('day3.txt',sep=' ',header=None))/2).astype(int).values),2))
*
(int("".join(str(i) for i in (pd.read_csv('day3.txt',sep=' ',header=None,dtype='str')[0].str.split("",
expand = True)[range(1,
len(pd.read_csv('day3.txt',sep=' ',
header=None,dtype='str')[0].str.split("",expand = True).columns)-1)].applymap(int).sum()<len(pd.read_csv('day3.txt',sep=' ',header=None))/2).astype(int).values),2)))