Thursday, September 27, 2018

Using Excel with pandas

it's hard to find an organization that doesn't work with it in some way. From analysts, to sales VPs, to CEOs, various professionals use Excel for both quick stats and serious data crunching.
With Excel being so pervasive, data professionals must be familiar with it. You'll also want a tool that can easily read and write Excel files — pandas is perfect for this.
Pandas has excellent methods for reading all kinds of data from Excel files. You can also export your results from pandas back to Excel, if that's preferred by your intended audience. Pandas is great for other routine data analysis tasks, such as:
  • quick Exploratory Data Analysis (EDA)
  • drawing attractive plots
  • feeding data into machine learning tools like scikit-learn
  • building machine learning models on your data
  • taking cleaned and processed data to any number of data tools
Pandas is better at automating data processing tasks than Excel, including processing Excel files.

 

System prerequisites

We will use Python 3 and Jupyter Notebook to demonstrate the code in this tutorial.
In addition to Python and Jupyter Notebook, you will need the following Python modules:
  • matplotlib - data visualization
  • NumPy - numerical data functionality
  • OpenPyXL - read/write Excel 2010 xlsx/xlsm files
  • pandas - data import, clean-up, exploration, and analysis
  • xlrd - read Excel data
  • xlwt - write to Excel
  • XlsxWriter - write to Excel (xlsx) files
    


The data set

In this tutorial, we will use a multi-sheet Excel file we created from Kaggle's IMDB Scores data





Read data from the Excel file

We need to first import the data from the Excel file into pandas. To do that, we start by importing the pandas module.

"We need to first import the data from the Excel file into pandas. To do that, we start by importing the pandas module."

import pandas as pd

excel method to read in data from the Excel file. The easiest way to call this method is to pass the file name. If no sheet name is specified then it will read the first sheet

excel_file = 'movies.xls'
movies = pd.read_excel(excel_file)

method read the data from the Excel file into a pandas DataFrame object. Pandas defaults to storing data in DataFrames. We then stored this DataFrame into a variable called movies.
Pandas has a built-in DataFrame.head() method that we can use to easily display the first few rows of our DataFrame. If no argument is passed, it will display first five rows. If a number is passed, it will display the equal number of rows from the top.


movies.head()

Output

cast TotalFacebook likes - MovieFacenumber in postersUser VotesReviews by UsersReviews by CrtiicsIMDB Score
0Intolerance: Love's Struggle Throughout the Ages1916Drama|History|WarNaNUSANot Rated1231.33385907.0NaN...436229.04816911107188869.08.0
1Over the Hill to the Poorhouse1920Crime|DramaNaNUSANaN1101.33100000.03000000.0...220.0401511.04.8
2The Big Parade1925Drama|Romance|WarNaNUSANot Rated1511.33245000.0NaN...81126.0108226048494548.08.3
3Metropolis1927Drama|Sci-FiGermanGermanyNot Rated1451.336000000.026435.0...1362318.0203120001111841413260.08.3
4Pandora's Box1929Crime|Drama|RomanceGermanGermanyNot Rated1101.33NaN9950.0...426203.0455926174318471.08.0


















 

Wednesday, September 26, 2018

GUI WITH PYTHON

Tikinter Python

Some Basic Intro:


Most of the time, the Tkinter module is all you really need, but a number of additional modules are available as well. The Tk interface is located in a binary module named _tkinter. This module contains the low-level interface to Tk, and should never be used directly by application programmers. It is usually a shared library (or DLL), but might in some cases be statically linked with the Python interpreter.


In addition to the Tk interface module, Tkinter includes a number of Python modules. The two most important modules are the Tkinter module itself, and a module called Tkconstants. The former automatically imports the latter, so to use Tkinter, all you need to do is to import one module:
import Tkinter
Or, more often:
from Tkinter import *
class Tkinter.Tk(screenName=None, baseName=None, className='Tk', useTk=1)
The Tk class is instantiated without arguments. This creates a toplevel widget of Tk which usually is the main window of an application. Each instance has its own associated Tcl interpreter.
Changed in version 2.4: The useTk parameter was added.
Tkinter.Tcl(screenName=None, baseName=None, className='Tk', useTk=0)
The Tcl() function is a factory function which creates an object much like that created by the Tk class, except that it does not initialize the Tk subsystem. This is most often useful when driving the Tcl interpreter in an environment where one doesn’t want to create extraneous toplevel windows, or where one cannot (such as Unix/Linux systems without an X server). An object created by the Tcl() object can have a Toplevel window created (and the Tk subsystem initialized) by calling its loadtk() method.
New in version 2.4.

Example of Tikinter Using Basic Lib

 In this example we will see the use of button and label in python GUI Programme,

from tkinter import *
root=Tk()
# =============================================================================
# theLabel=Label(root,text="Too Easy")
# theLabel.pack()

topFrame=Frame(root)
topFrame.pack()

bottomFrame=Frame(root)
bottomFrame.pack(side=BOTTOM)


button1=Button(topFrame,text="Button 1",fg="red")
button2=Button(topFrame,text="Button 2",fg="blue")
button3=Button(topFrame,text="Button 3",fg="green")
button4=Button(bottomFrame,text="Button 4",fg="purple")



button1.pack(side=LEFT)
button2.pack(side=LEFT)
button3.pack(side=LEFT)
button4.pack(side=BOTTOM)
root.mainloop()
 
Output:
 
 
 
 

Tuesday, September 25, 2018

Job changes by 2023

Now as we are moving towards 2019 we are seeing changes in terms of jobs designations.
This time we are getting data from world level in terms of which position are in the inches and which position will occur by 2022.

Automation Solutions


JOB in 2019

Automated - Digital One o One Meetings- An Idea

                                            Automated - Digital One o One Discussion                                                       ...