Posts

Logging in Python

Image
Hello all, This is the ninth article in the series  Python for Data Science . If you are new to this series, we would recommend you to read our previous articles Python for Data Science Series - Part 1 Python for Data Science Series - Part 2 Using Numpy in Python Using Pandas in Python Data Visualization using Matplotlib Python Parsing XML file in python Parsing Json file in python Interactive Data Visualization using Plotly in Python Please refer the videos below for detailed explanation on how to use logging in Python Please refer the following code to understand on how to implement logging in python In [1]: import logging import os In [2]: main_folder_path = r "E:\openknowledgeshare.blogspot.com\Python\Outputs" log_file_path = os . path . join ( main_folder_path , 'mylogfile.log' ) logging . basicConfig ( filename = log_file_path , filemode = 'w' , format = ' %(name)s - %(levelname)s - %(message...

Interactive Data Visualization using Plotly in Python

Image
Hello all, This is the eighth article in the series  Python for Data Science . If you are new to this series, we would recommend you to read our previous articles Python for Data Science Series - Part 1 Python for Data Science Series - Part 2 Using Numpy in Python Using Pandas in Python Data Visualization using Matplotlib Python Parsing XML file in python Parsing Json file in python To install plotly in your python environment, please use the below command pip install plotly Please refer the videos below for detailed explanation on plotly After you have installed plotly, please refer the following notebook to understand on how to use its  functionalities. In [4]: import plotly import os import plotly.graph_objects as go main_folder_path = r "E:\openknowledgeshare.blogspot.com\Python\Outputs" fig = go . Figure ( data = go . Bar ( y = [ 2 , 3 , 1 ])) plotly . offline . plot ( fig , filename = os . path . join ( main_folder_path , "...

Parsing Json file in python

Image
Hello all, This is the seventh article in the series  Python for Data Science . If you are new to this series, we would recommend you to read our previous articles Python for Data Science Series - Part 1 Python for Data Science Series - Part 2 Using Numpy in Python Using Pandas in Python Data Visualization using Matplotlib Python Parsing XML file in python Please refer the videos below for detailed explanation on how to parse json in python. Please refer the following notebook to understand on how to do json parsing in python. In [4]: import json import os In [2]: main_folder_path = r "E:\openknowledgeshare.blogspot.com\Python\Outputs" In [6]: json_file_path = os . path . join ( main_folder_path , 'Sample_Json.json' ) In [7]: f = open ( json_file_path , "r" ) json_data = f . read () f . close () In [8]: json_data ...

Parsing XML file in python

Image
Hello all, This is the sixth article in the series  Python for Data Science . If you are new to this series, we would recommend you to read our previous articles Python for Data Science Series - Part 1 Python for Data Science Series - Part 2 Using Numpy in Python Using Pandas in Python Data Visualization using Matplotlib Python Please refer the videos below for detailed explanation on how to parse xml in python. Please refer the following notebook to understand on how to do xml parsing in python. In [4]: import csv import requests import xml.etree.ElementTree as ET import os In [2]: main_folder_path = r "E:\openknowledgeshare.blogspot.com\Python\Outputs" In [5]: url = 'http://www.hindustantimes.com/rss/topnews/rssfeed.xml' # creating HTTP response object from given url resp = requests . get ( url ) # saving the xml file with open ( os . path . join ( main_folder_path , ...

Data Visualization using Matplotlib Python

Image
Hello all, This is the fifth article in the series  Python for Data Science . If you are new to this series, we would recommend you to read our previous articles Python for Data Science Series - Part 1 Python for Data Science Series - Part 2 Using Numpy in Python Using Pandas in Python To install matplotlib in your python environment, please use the below command pip install matplotlib Please refer the videos below for detailed explanation on matplotlib After you have installed Matplotlib, please refer the following notebook to understand on how to use its  functionalities. In [1]: #import matplotlib import matplotlib.pyplot as plt import numpy as np In [2]: # Data for plotting t = np . arange ( 0.0 , 2.0 , 0.01 ) t Out[2]: array([0. , 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1 , 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2 , 0.21, 0.22, 0.23, 0.24, 0.2...