Extract The Useful Data from JSON File For Machine Learning

Ankit Gupta
Analytics Vidhya
Published in
2 min readAug 13, 2018
Working-With-JSON-Data-in-Python_Watermarked.jpeg

You need the following things before you start parsing and extraction:

  1. JASON File. (Download the file)
  2. Jupyter NoteBook.
  3. Some essential Modules named as Numpy, Matplotlib and many more.
  4. Jason Parser(to understand data of Jason file for extraction of useful Data).
Fig1:JSON Parser Online to Analyze

5. GitHub Account(store your current project).

6. Code Begins —

  • Functions that the OS module provides allows you to interface with the underlying operating system that Python is running on — be that Windows, Mac or Linux.
https://gist.github.com/ankitAMD/e1d2285c0558bd1c1732a7b4df97f984

NumPy package is used to perform different operations while Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy.

https://gist.github.com/ankitAMD/b65b985497eedd7fc6eac48d96f07beb
  • Import the following packages:
https://gist.github.com/ankitAMD/633e54ab7a9167075d689b06207271dd
https://gist.github.com/ankitAMD/e1e557208976120fc89c74bd0b69dd41
Fig2:Output of above Code/ Try to run the code line by line to better intuition.
Fig3:Output of the above Code.
Fig4:Output of the above Code.

In the code ……..

fill ="yellow"           # Use for Colour

In the code……..

draw.polygon((points), fill = “green”) #Use for draw the Polygon .

In the code………

image.show()             #Use for show the image .

In the code……..

image.save(kk)           #Use for saving the image .

………………………………………………………………………………….

Analyze the Code and Perform #Code# line by line .

Also Go to my github Profile for more better intuition of code .

Thank you for reading …………………………………………………….

Please Clap and Follow for More ,Easy and Interesting Articles.

--

--

Analytics Vidhya
Analytics Vidhya

Published in Analytics Vidhya

Analytics Vidhya is a community of Generative AI and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Ankit Gupta
Ankit Gupta

Written by Ankit Gupta

Cloud Engineer. Website: Clickaws.com, gorakhpurgraphs.com , Instagram: Ninjaankit1