true

Find the best tutors and institutes for Python Training

Find Best Python Training classes

Please select a Category.

Please select a Locality.

No matching category found.

No matching Locality found.

Outside India?

Search for topics

Python Training Updates

Ask a Question

Post a Lesson

All

All

Lessons

Discussion

Lesson Posted on 08/04/2020 IT Courses/Programming Languages/Python IT Courses/Programming Languages/Python/Python Advanced IT Courses/Data Science

Code: Gantt Chart: Horizontal bar using matplotlib for tasks with Start Time and End Time

Rishi Bansal

Have 12 years of experience in programming using Python &Shell Script, Cloud & Virtualization technology,...

import pandas as pd from datetime import datetimeimport matplotlib.dates as datesimport matplotlib.pyplot as plt def gantt_chart(df_phase): # Now convert them to matplotlib's internal format... df_phase = pd.to_datetime(df_phase, format='%Y-%m-%d %H:%M:%S.%f') df_phase = pd.to_datetime(df_phase,... read more

import pandas as pd   
from datetime import datetime
import matplotlib.dates as dates
import matplotlib.pyplot as plt

 

def gantt_chart(df_phase):

    # Now convert them to matplotlib's internal format...

    df_phase['Start Time'] = pd.to_datetime(df_phase['Start Time'], format='%Y-%m-%d %H:%M:%S.%f')

    df_phase['End Time'] = pd.to_datetime(df_phase['End Time'], format='%Y-%m-%d %H:%M:%S.%f')

    #Convert DF columns into lists, plt will take all values in scalar or list

    sdate = df_phase['Start Time'].tolist()

    edate = df_phase['End Time'].tolist()

    plugin = df_phase['Plugin'].tolist()

    status = df_phase['Status'].tolist()

    color = []

    #Store colors for success and failure to differentiate

    for i in range(0, len(status)):

        if status[i] == 'Success':

            color.append('green')

        else:

            color.append('red')

    #Convert time to Matplotlib number format

    edate, sdate = [dates.date2num(item) for item in (edate, sdate)]

    ypos = range(len(plugin))

    fig, ax = plt.subplots()

    time_diff = edate - sdate

    # Plot the data, color is scalar or a list

    # All are in form of list

    ax.barh(ypos, time_diff, left=sdate, linewidth = 0.5, height=0.8, align='center', color=color)

    plt.yticks(ypos, plugin)

    plt.xticks(rotation=-20)

    ax.axis('tight')

 

    # We need to tell matplotlib that these are dates...

    ax.xaxis_date()

    plt.ylabel('Plugins', fontsize='medium', stretch = 'normal')

    # bbox_inches='tight' will prevent cutting of y-label

    fig.savefig(image_file, bbox_inches='tight')

    plt.show()

 

 

data = [['A', '2019-06-27 18:33:58.033', '2019-06-27 19:54:04.658', 'Success'], ['B', '2019-06-27 19:54:04.957', '2019-06-27 19:58:14.570', 'Success'], ['C', '2019-06-27 19:54:04.963', '2019-06-27 19:54:19.928', 'Failed']]

df_phase = pd.DataFrame(data, columns = [Plugin, 'Start Time', 'End Time', 'Status'])

#Calling the function

gantt_chart(df_phase)

 

Note: This is authored my me only, you can find it on my blog.

read less
Comments
Dislike Bookmark

Answered on 04/06/2020 Tuition/BTech Tuition IT Courses/Programming Languages/Python IT Courses/Programming Languages/Python/Python Anaconda +1 IT Courses/Programming Languages/Python/Python Advanced less

Piyush Gupta

Build Yourself For The Future

Can't solve because product price is a part of the tuple. Since LIST IS MUTABLE so we can change its elements. We can change the whole tuple because it is an element of the list. As WKT TUPLE IS IMMUTABLE so we can't change its elements.
Answers 24 Comments
Dislike Bookmark

Lesson Posted on 01/04/2020 IT Courses/Programming Languages/Python/Python 3.8 IT Courses/Programming Languages/Python IT Courses/Programming Languages/Python/Python Advanced +2 IT Courses/Programming Languages/Python/Python Classes IT Courses/Programming Languages/Python/Python Beginner less

Why Python

NubeEra

NubeEra E-Learning Platform is Worlds s First leading Knowledge Sharing Industry which focus on ABCD-(Analytics-...

Python can be used in any futuristics technology A= Analytics Data Science Artificial Intelligence(AI) Neural Network(NN) Natural Language Processing(NLP) Computer Vision(OpenCV) In Analytics some of the use cases are Google uses in Self-driving Car and major projects Youtube uses... read more

Python can be used in any futuristics technology

  • A= Analytics
    • Data Science
    • Artificial Intelligence(AI)
    • Neural Network(NN)
    • Natural Language Processing(NLP)
    • Computer Vision(OpenCV)
    • In Analytics some of the use cases are
    1. Google uses in Self-driving Car and major projects
    2. Youtube uses Python
  • B = Big Data
    • Spark is the fastest Analytical Processing Engine which is 100X Faster then Hadoop
    • PySpark market demands in jobs, projects and essential industrial tool.
  • C = Cloud Computing
    • AWS-Amazon Web Service uses Python to work with Microservices
    • Microsoft Azure- uses Python in CLI
    • Google Cloud Platform(GCP) uses Python
  • D = Development / DevOps 
    • Professional moving from Java and another language to Python

 

read less
Comments
Dislike Bookmark

Looking for Python Training classes

Find best Python Training classes in your locality on UrbanPro.

FIND NOW

Answered on 29/02/2020 IT Courses/Programming Languages/Python

Anubhav Kumar

Experienced & certified Digital Marketer last more than 10 years

Android doesn't support python but you can convert easily python to android app.
Answers 24 Comments
Dislike Bookmark

Answered on 21/01/2020 IT Courses/Programming Languages/Python

Barun Kumar Mishra

Corporate Data Science Trainer in Python, SAS Base, SAS Advance, Advanced Excel with Analytics (RBS)

First of all, most of the companies have criteria for graduate or equivalent.2nd, if you want to go with SAP, it requires at least 1-2 years experience to get you a job. You get a job in a particular domain in SAP.Python lands you in a job as a fresher too.Data Science with Python is the course that... read more

First of all, most of the companies have criteria for graduate or equivalent.
2nd, if you want to go with SAP, it requires at least 1-2 years experience to get you a job. You get a job in a particular domain in SAP.
Python lands you in a job as a fresher too.
Data Science with Python is the course that you can go for, which is not the only job oriented but the future.
The market has a vast requirement of Data Scientist.
3rd, if you feel you are a diploma holder and you won't be able to get jobs in these areas, go for Advanced Excel. It is used widely almost everywhere, and later on, you can switch on to Python as these Technologies are of the same field, i.e. Analytics.

read less
Answers 16 Comments
Dislike Bookmark

Answered on 10/03/2020 IT Courses/Programming Languages/Python IT Courses/Java IT Courses/Programming Languages/PHP

Charlie

It completely depends on your interest, because both are two completely different fields. Python is a scripting language, which is used in the field of development and automation. It also aids in many of the trending technologies like Data Science and Machine learning. SEO stands for Search Engine Optimization.... read more

It completely depends on your interest, because both are two completely different fields. Python is a scripting language, which is used in the field of development and automation. It also aids in many of the trending technologies like Data Science and Machine learning. SEO stands for Search Engine Optimization. It finds its use in the field of Digital Marketing. Expert knowledge and relevant experience in this field will even aid you in starting your own business or in freelancing. If you're interested in the field of development(whether frontend or backend), automation and other software fields, then it is best to choose Python over any different language. If you're a person who wants to pursue Digital Marketing, then you can select SEO.  Both fields have their pros and cons in terms of job prospects.

read less
Answers 3 Comments
Dislike Bookmark

Answered on 10/03/2020 IT Courses/Programming Languages/Python IT Courses/Java IT Courses/Programming Languages/PHP

Charlie

There are a lot of ways by which you can learn Python efficiently. The primary source of knowledge is by watching Youtube videos. There are a lot of channels on the platform that offers free online training to learn the language from scratch. You can also learn the concepts from books. One of the most... read more

There are a lot of ways by which you can learn Python efficiently. The primary source of knowledge is by watching Youtube videos. There are a lot of channels on the platform that offers free online training to learn the language from scratch. You can also learn the concepts from books. One of the most famous ones is "Learn Python the Hard Way" by Zed Shaw. It provides you with the insights of the concept and explains every concept in detail. But once you refer books or other youtube channels, you'll have to sit and code it by yourself. This is how you will learn the language. Unless you have a piece of theoretical knowledge, you will not be able to master the language. If both these methods do not work for you, then you can hire a tutor and learn from them, or join an institute.

read less
Answers 3 Comments
Dislike Bookmark

Answered on 10/03/2020 IT Courses/Programming Languages/Python IT Courses/Java IT Courses/Programming Languages/PHP

Charlie

Python is not great for hacking; one would say an essential quality is whatever programming or scripting language one would use for hacking is that does not require compiling between hack attempts and getting feedback on what would work and what does not. One would use Bash over Python for hacking; you... read more

Python is not great for hacking; one would say an essential quality is whatever programming or scripting language one would use for hacking is that does not require compiling between hack attempts and getting feedback on what would work and what does not. One would use Bash over Python for hacking; you seamlessly transition between the terminal and the text editor with Bash. For, prototyping and cobbling python is absolutely fabulous, it is just that python is a universal language with a ton of online resources, and maybe that factor is assumed to make python as goto language for hacking.

Happy Coding

read less
Answers 3 Comments
Dislike Bookmark

Answered on 10/03/2020 IT Courses/Programming Languages/Python IT Courses/Java IT Courses/Programming Languages/PHP

Charlie

Creating general-purpose chatbot which would be unbiased would still be not possible. Considerable research is going in this field. We can create a chatbot for a specific purpose. Before one can create a chatbot, there are some pre-requisites let the list out them first. You should know Natural Language... read more

Creating general-purpose chatbot which would be unbiased would still be not possible. Considerable research is going in this field. We can create a chatbot for a specific purpose. Before one can create a chatbot, there are some pre-requisites let the list out them first. You should know Natural Language Processing, Neural Networks, which is another way called Deep Learning, Regular Expressions in Python. After having a basic idea on what Neural Networks are and knowing they work. You would need to know about the model called Long Short Memory. After knowing all these things, we can create our chatbot.

I hope this helps.

read less
Answers 3 Comments
Dislike Bookmark

Looking for Python Training classes

Find best Python Training classes in your locality on UrbanPro.

FIND NOW

Lesson Posted on 30/03/2017 IT Courses/Programming Languages/Python Tuition/BTech Tuition

Python - Solving Ordinary Differential Equations - Predator Prey Model aka Lotka Volterra Equations

Sri Vallabha

This is an assignment in Python, I contributed to a numerical Python MOOC from George Washington University. The link to this assignment on github is here. The Lotka–Volterra equations, also known as the predator–prey equations, are a pair of first-order, non-linear, differential equations.... read more

This is an assignment in Python, I contributed to a numerical Python MOOC from George Washington University. The link to this assignment on github is here.

The Lotka–Volterra equations, also known as the predator–prey equations, are a pair of first-order, non-linear, differential equations. They are frequently used to describe the dynamics of biological systems in which two species interact, one as a predator and the other as prey. You can read more about this from Wikipedia http://en.wikipedia.org/wiki/Lotka-Volterra_equation.

Equations describing the system

Their populations change with time according to the following pair of equations:

$ dx/dt = x ( \alpha - \beta y ) $

$ dy/dt = -y( \gamma - \delta x ) $

Where, $x$ is the number of prey (say rabbits), $y$ is the number of predators (say foxes). $dx/dt, dy/dt$ gives the rate of change of their respective populations over time $t$. $\alpha, \beta, \gamma, \delta $ are the parameters describing the interaction between the two species. This models makes some assumptions about the predator and prey. You can read about them from the Wikipedia page mentioned above.

 

The above equations can be written in a slightly different form to interpret the physical meaning of the four parameters used.

1.Equation for prey

$dx/dt = \alpha x - \beta x y $

The prey are supposed to have unlimited supply of food and $\alpha x$ represents the rate of population growth of prey. Rate of decrease of population of prey is assumed to be proportional to the rate at which predator and prey meet and is given by $ \beta y x$

2.Equation for predator

$ dy/dt = \delta x y -\gamma y $

For the predators, $\delta x y $ gives the rate of growth of predator population. Note that this is similar to the rate of decrease of population of prey. The second term $\gamma y $ gives the rate of population decrease for predators due to natural death or emigration.

Numerical solution using Python

A simple python code for solving these equations is shown below.

 

# importrequired libraries
import numpy
import matplotlib.pyplot as plt
%matplotlib inline

# set the initial parameters
alpha = 1.
beta = 1.2
gamma = 4.
delta = 1.
 
#define the time stepping scheme - euler forward, as used in earlier lessons
def euler_step(u, f, dt):
    """Returns the solution at the next time-step using Euler's method.
    
    Parameters
    ----------
    u : array of float
        solution at the previous time-step.
    f : function
        function to compute the right hand-side of the system of equation.
    dt : float
        time-increment.
    
    Returns
    -------
    u_n_plus_1 : array of float
        approximate solution at the next time step.
    """
    
    return u + dt * f(u)


# define the function that represents the Lotka-Volterra equations
def f(u):
    """Returns the rate of change of species numbers.
    
    Parameters
    ----------
    u : array of float
        array containing the solution at time n.
        
    Returns
    -------
    dudt : array of float
        array containing the RHS given u.
    """
    x = u[0]
    y = u[1]
    return numpy.array([x*(alpha - beta*y), -y*(gamma - delta*x)])

# set time-increment and discretize the time
T  = 15.0                           # final time
dt = 0.01                           # set time-increment
N  = int(T/dt) + 1                  # number of time-steps
x0 = 10.
y0 = 2.
t0 = 0.

# set initial conditions
u_euler = numpy.empty((N, 2))

# initialize the array containing the solution for each time-step
u_euler[0] = numpy.array([x0, y0])

# use a for loop to call the function rk2_step()
for n in range(N-1):
    
    u_euler[n+1] = euler_step(u_euler[n], f, dt)

time = numpy.linspace(0.0, T,N)
x_euler = u_euler[:,0]
y_euler = u_euler[:,1]

plt.plot(time, x_euler, label = 'prey ')
plt.plot(time, y_euler, label = 'predator')
plt.legend(loc='upper right')
#labels
plt.xlabel("time")
plt.ylabel("number of each species")
#title
plt.title("predator prey model")
read less
Comments 1
Dislike Bookmark

About UrbanPro

UrbanPro.com helps you to connect with the best Python Training classes in India. Post Your Requirement today and get connected.

Overview

Questions 1.2 k

Lessons 79

Total Shares  

+ Follow 79,544 Followers

Top Contributors

Connect with Expert Tutors & Institutes for Python

x

Ask a Question

Please enter your Question

Please select a Tag

X

Looking for Python Training Classes?

Find best tutors for Python Training Classes by posting a requirement.

  • Post a learning requirement
  • Get customized responses
  • Compare and select the best

Looking for Python Training Classes?

Find best Python Training Classes in your locality on UrbanPro

Post your learning requirement

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 25 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 6.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more