Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dictionary to storred data
#1
Hi All

i just start python and if possible help with dictionary

INPUT FILE
THE 1-3 KEY value
1 2 3
ABC E 00001
ABC E 00003
ABC B 00001
ABC B 00005
ABC N 00001
ABC W 00001
XYZ E 00001
XYZ B 00001
XYZ N 00001
XYZ W 00001

Reading file i need to store value build in dictionary

need counts how many ABC E COUNTS AND ADD filed 3
need counts how many ABC B COUNTS AND ADD filed 3
need counts how many ABC W COUNTS AND ADD filed 3
need counts how many ABC N COUNTS AND ADD filed 3

need counts how many XYZ E COUNTS AND ADD filed 3
need counts how many XYZ B COUNTS AND ADD filed 3
need counts how many XYZ W COUNTS AND ADD filed 3
need counts how many XYZ N COUNTS AND ADD filed 3



AT END I NEED TO READ dictionary

AND WRITE FILES

the data should be dictionary


ABC E 2 00004
ABC B 2 00006
ABC N 1 00001
ABC W 1 00001
XYZ E 1 00001
XYZ B 1 00001
XYZ N 1 00001
XYZ W 1 00001


Please help Any idea how i should start with this?

Thank you
Reply
#2
Make an effort, show what you come up with and where specifically you need help
Reply
#3
Hi

Thank you

I build the table like This

letterDic2 = {'PIN': {'E': [10,20]}}
letterDic2 = {'PIN': {'B: [0,0]}}
letterDic2 = {'PIN': {'W': [5,10]}}
letterDic2 = {'PIN': {'N': [10,20]}}

The count will be stored in each value [0] [1]

At end i want to read all rows in the dictionary and look for index[0] each row not 0 then do ........

What is the correct way doing this
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Matching Data - Help - Dictionary manuel174102 1 405 Feb-02-2024, 04:47 PM
Last Post: deanhystad
  [SOLVED] Concat data from dictionary? Winfried 4 1,732 Mar-30-2022, 02:55 PM
Last Post: Winfried
  Python, how to manage multiple data in list or dictionary with calculations and FIFO Mikeardy 8 2,615 Dec-31-2021, 07:47 AM
Last Post: Mikeardy
  Converting data in CSV and TXT to dictionary kam_uk 3 1,994 Dec-22-2020, 08:43 PM
Last Post: bowlofred
  Issue accessing data from Dictionary/List in the right format LuisSatch 2 2,222 Jul-25-2020, 06:12 AM
Last Post: LuisSatch
  problem coverting string data file to dictionary AKNL 22 6,468 Mar-10-2020, 01:27 PM
Last Post: AKNL
  Read csv file, parse data, and store in a dictionary markellefultz20 4 4,591 Nov-26-2019, 03:33 PM
Last Post: DeaD_EyE
  Organizing Data in Dictionary Ranjirock 3 2,634 Aug-27-2019, 02:48 PM
Last Post: Ranjirock
  Dictionary for Excel Data Ranjirock 0 25,370 Aug-18-2019, 05:26 PM
Last Post: Ranjirock

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020