Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
ban265
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Ang
ban265
Commits
f007e341
Commit
f007e341
authored
Mar 20, 2024
by
MichaelAng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ban265] use supermarket csv
parent
f1a4dedd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
hw4.py
hw4.py
+3
-2
supermarket.csv
supermarket.csv
+21
-0
No files found.
hw4.py
View file @
f007e341
...
...
@@ -10,12 +10,13 @@
import
csv
target_record
=
2_000_000
with
open
(
"
record
.csv"
,
"r"
)
as
file
:
target_record
=
15
with
open
(
"
supermarket
.csv"
,
"r"
)
as
file
:
reader
=
csv
.
DictReader
(
file
)
for
i
,
row
in
enumerate
(
reader
):
if
i
==
target_record
:
print
(
"Date: "
,
row
.
get
(
"Date"
))
print
(
"Transaction Number: "
,
row
.
get
(
"Transaction Number"
))
print
(
"UPC Number: "
,
row
.
get
(
"UPC Number"
))
print
(
"Customer Account: "
,
row
.
get
(
"Customer Account"
))
print
(
"Sale Price: "
,
row
.
get
(
"Sale Price"
))
supermarket.csv
0 → 100644
View file @
f007e341
Date,Transaction Number,UPC Number,Product Name,Customer Account,Qty,Regular Price,Sale Price,Discount
2016-04-25 13:34:35.287,T001,P001,EGGPLANT,C001,1.25,1.9900000000000,1.99,0.00
2016-04-25 13:34:35.297,T001,P001,EGGPLANT,C001,1.26,1.9900000000000,1.99,0.00
2016-04-25 13:34:35.307,T001,P002,MILK,C001,1,3.9900000000000,3.99,0.00
2016-04-26 13:34:35.287,T002,P001,EGGPLANT,C002,1.25,1.9900000000000,1.99,0.00
2016-04-26 13:34:35.297,T002,P003,BREAD,C002,2,0.9900000000000,0.99,0.00
2016-04-26 13:34:35.307,T002,P002,MILK,C002,1,3.9900000000000,3.99,0.00
2016-05-01 13:34:35.287,T003,P001,EGGPLANT,C002,1.25,1.9900000000000,1.99,0.00
2016-05-01 13:34:35.297,T003,P003,BREAD,C002,3,0.9900000000000,0.99,0.00
2016-05-09 13:34:35.287,T004,P001,EGGPLANT,C002,1.25,1.9900000000000,1.99,0.00
2016-05-09 13:34:35.297,T004,P003,BREAD,C002,3,0.9900000000000,0.99,0.00
2016-05-10 13:34:35.297,T005,P001,EGGPLANT,C001,1.26,1.9900000000000,1.99,0.00
2016-05-10 13:34:35.307,T005,P002,MILK,C001,1,3.9900000000000,3.99,0.00
2016-05-19 13:34:35.287,T006,P001,EGGPLANT,C002,1.25,1.9900000000000,1.99,0.00
2016-05-19 13:34:35.297,T006,P003,BREAD,C002,3,0.9900000000000,0.99,0.00
2016-05-26 13:34:35.287,T007,P001,EGGPLANT,C001,1.25,1.9900000000000,1.99,0.00
2016-05-26 13:34:35.297,T007,P001,EGGPLANT,C001,1.26,1.9900000000000,1.99,0.00
2016-05-26 13:34:35.307,T007,P002,MILK,C001,1,3.9900000000000,3.99,0.00
2016-05-29 13:34:35.287,T008,P001,EGGPLANT,C002,1.25,1.9900000000000,1.99,0.00
2016-05-29 13:34:35.297,T008,P003,BREAD,C002,3,0.9900000000000,0.99,0.00
2016-06-12 13:34:35.297,T009,P003,BREAD,C003,3,0.9900000000000,0.99,0.00
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment