Question

i have a huge json file , it has a key call type(the type of crime...

i have a huge json file , it has a key call type(the type of crime commited), date and time(date crime was commited) , and location(address or lat&long) among other keys with values. Im mostly interested in counting the days with the most crimes , counting what call types show up the most, and what location shows up the most also, the location can measure by the home address or pairing the latitude and longitude together. Python would probably be best . THERES OVER 350 TYPES OF CALL TYPES ON A JSON WITH OVER 350K DATA ROWS. So everything time you see a new call type it should like create a new variable for that and keep track of it

i tried iterating threw it like a list but having issues . how can i attach to my code when its 62 mb , should i link to a file?

this is an example of data

[{"A": "incident_num", "B": "date_time", "C": "day", "D": "stno", "E": "stdir1", "F": "StreetName", "G": "streettype", "H": "FullAddress", "I": "call_type", "J": "disposition", "K": "beat", "L": "priority", "M": "lat", "N": "long"},
{"A": "P17060024503", "B": "6/14/2017 21:54", "C": "4", "D": "10", "E": "", "F": "14TH", "G": "ST", "H": "10 14TH ST, San Diego, CA", "I": "1151", "J": "O", "K": "521", "L": "2", "M": "32.7054489", "N": "-117.1518696"},
{"A": "P17030051227", "B": "3/29/2017 22:24", "C": "4", "D": "10", "E": "", "F": "14TH", "G": "ST", "H": "10 14TH ST, San Diego, CA", "I": "1016", "J": "A", "K": "521", "L": "2", "M": "32.7054489", "N": "-117.1518696"},
{"A": "P17060004814", "B": "6/3/2017 18:04", "C": "7", "D": "10", "E": "", "F": "14TH", "G": "ST", "H": "10 14TH ST, San Diego, CA", "I": "1016", "J": "A", "K": "521", "L": "2", "M": "32.7054489", "N": "-117.1518696"},
{"A": "P17030029336", "B": "3/17/2017 10:57", "C": "6", "D": "10", "E": "", "F": "14TH", "G": "ST", "H": "10 14TH ST, San Diego, CA", "I": "1151", "J": "OT", "K": "521", "L": "2", "M": "32.7054489", "N": "-117.1518696"},
{"A": "P17030005412", "B": "3/3/2017 23:45", "C": "6", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "911P", "J": "CAN", "K": "521", "L": "2", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17020016091", "B": "2/10/2017 8:23", "C": "6", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "AU2", "J": "W", "K": "521", "L": "2", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17040017368", "B": "4/11/2017 4:57", "C": "3", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "5150", "J": "CAN", "K": "521", "L": "2", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17030048050", "B": "3/28/2017 6:30", "C": "3", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "1146", "J": "K", "K": "521", "L": "", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17060037341", "B": "6/22/2017 10:19", "C": "5", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "242", "J": "K", "K": "521", "L": "1", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17060008467", "B": "6/5/2017 19:27", "C": "2", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "5150", "J": "K", "K": "521", "L": "2", "M": "32.7057215", "N": "-117.1503498"},

i just want stats for like each call type that was made and how much time it was made for each Key I , how calls where made for each address Key F , and the calls for each date time that shows up key B? YOU CAN IGNORE OTHER COLUMNS , python would be best but if other language is fine

0 0
Add a comment Improve this question Transcribed image text
Answer #1

import pandas as pd

data= [{"A": "incident_num", "B": "date_time", "C": "day", "D": "stno", "E": "stdir1", "F": "StreetName", "G": "streettype", "H": "FullAddress", "I": "call_type", "J": "disposition", "K": "beat", "L": "priority", "M": "lat", "N": "long"},
{"A": "P17060024503", "B": "6/14/2017 21:54", "C": "4", "D": "10", "E": "", "F": "14TH", "G": "ST", "H": "10 14TH ST, San Diego, CA", "I": "1151", "J": "O", "K": "521", "L": "2", "M": "32.7054489", "N": "-117.1518696"},
{"A": "P17030051227", "B": "3/29/2017 22:24", "C": "4", "D": "10", "E": "", "F": "14TH", "G": "ST", "H": "10 14TH ST, San Diego, CA", "I": "1016", "J": "A", "K": "521", "L": "2", "M": "32.7054489", "N": "-117.1518696"},
{"A": "P17060004814", "B": "6/3/2017 18:04", "C": "7", "D": "10", "E": "", "F": "14TH", "G": "ST", "H": "10 14TH ST, San Diego, CA", "I": "1016", "J": "A", "K": "521", "L": "2", "M": "32.7054489", "N": "-117.1518696"},
{"A": "P17030029336", "B": "3/17/2017 10:57", "C": "6", "D": "10", "E": "", "F": "14TH", "G": "ST", "H": "10 14TH ST, San Diego, CA", "I": "1151", "J": "OT", "K": "521", "L": "2", "M": "32.7054489", "N": "-117.1518696"},
{"A": "P17030005412", "B": "3/3/2017 23:45", "C": "6", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "911P", "J": "CAN", "K": "521", "L": "2", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17020016091", "B": "2/10/2017 8:23", "C": "6", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "AU2", "J": "W", "K": "521", "L": "2", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17040017368", "B": "4/11/2017 4:57", "C": "3", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "5150", "J": "CAN", "K": "521", "L": "2", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17030048050", "B": "3/28/2017 6:30", "C": "3", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "1146", "J": "K", "K": "521", "L": "", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17060037341", "B": "6/22/2017 10:19", "C": "5", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "242", "J": "K", "K": "521", "L": "1", "M": "32.7057215", "N": "-117.1503498"},
{"A": "P17060008467", "B": "6/5/2017 19:27", "C": "2", "D": "10", "E": "", "F": "15TH", "G": "ST", "H": "10 15TH ST, San Diego, CA", "I": "5150", "J": "K", "K": "521", "L": "2", "M": "32.7057215", "N": "-117.1503498"}]

df=pd.Dataframe(data)

lst=list(df['call_type'])

print(lst)

Add a comment
Know the answer?
Add Answer to:
i have a huge json file , it has a key call type(the type of crime...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  •       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.     ...

          -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.    Telecommuting       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.    Change       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.    Job Sharing       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.    Job Redesign       -       A.       B.       C.       D.       E.       F.       G.       H.       I.      ...

  • The Kelsh Company has two divisions North and South. The divisions have the following revenues an...

    The Kelsh Company has two divisions North and South. The divisions have the following revenues and expenses: North South Sales $700,000 $600,000 Less Operating Expenses: Variable Expenses 350,000 250,000 Traceable Fixed Expenses 200,000 160,000 Allocated Common Corporate Expenses 180,000 730,000     120,000 530,000 Net Operating Income (Loss) $( 30,000) $ 70,000 Management at Kelsh is pondering the elimination of North Division. If North Division were eliminated, its traceable fixed expenses could be avoided. The total common corporate expenses would be unaffected....

  • IN PYTHON 3 LANGUAGE The windows generator takes an iterable and two ints (call them n...

    IN PYTHON 3 LANGUAGE The windows generator takes an iterable and two ints (call them n and m; with m’s default value 1) as parameters: it produces lists of n values: the first list contains the first n values; every subsequent list drops the first m from the previous list and adds the next m values from the iterable, until there are fewer than n values to put in the returned list. call iter and next directly, and use a...

  • This is a Python Program Write a program that encrypts letters based on the following key....

    This is a Python Program Write a program that encrypts letters based on the following key. Original letter to encrypted letter A M B L C K D J E I F H G G H F I E J D K C L B M A N Z O Y P X Q W R V S U T T U S V R W Q X P Y O Z N Write the output to a file

  • hi, my name Devin, i have an online class and this huge question is on my...

    hi, my name Devin, i have an online class and this huge question is on my hw. i already tried my first attempt and i only have one more. can i get some help double-checking my work? and yes its Calculate the pH corresponding to each of the hydrogen ion concentrations given below, and indicate whether each solution is acidic or basic.(a) [H+ ] = 3.94 10-5M (b) [H+ ] = 9.55 10-8M (c) [H+ ] = 2.12 10-10M (d)...

  • For each item, select the proper statistical term. Terms are only used once and each item...

    For each item, select the proper statistical term. Terms are only used once and each item has only one correct answer.       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.       P.    Hanna, CPA, identified the item in which...

  •       -       A.       B.       C.       D.   ...

          -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.    Telecommuting       -       A.       B.       C.       D.       E.       F.       G.       H.       I....

  • QUESTION 9 Match the complex to the correct metal name.       -       A....

    QUESTION 9 Match the complex to the correct metal name.       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.    K[Fe(H2O)2(ox)2]       -       A.       B.       C.       D.       E.       F.       G.       H.      ...

  • The table below shows several items and their hashcodes, as derived from some arbitrary hashing function....

    The table below shows several items and their hashcodes, as derived from some arbitrary hashing function. Assume you have a hashtable with an initial array size of 13 (0-based) and a load factor of 0.75. Assume the array is always doubled when it needs to be resized (i.e., the table size sequence is: 13, 26, 52, 104, ...). Assume the items are added in the order in which they are listed, and assume the hashtable uses quadratic probing to resolve...

  • why is this wrong for vectors vector<char> decrypt{ {'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',...

    why is this wrong for vectors vector<char> decrypt{ {'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A'}, {'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'}, }; for(int...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT