Plotting Excel Chart with Pattern Fills Using XlsxWriter in Python

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:24:37

194 Views

Charts are composed of at least one series of one or more data points. Series themselves are comprised of references to cell ranges. For plotting the charts on an excel sheet, firstly, create chart object of specific chart type( i.e Column chart etc.). After creating chart objects, insert data in it and lastly, add that chart object in the sheet object.Example# import xlsxwriter module import xlsxwriter #Workbook()takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_pattern.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method. worksheet = workbook.add_worksheet() ... Read More

Plotting Excel Chart with Gradient Fills Using XlsxWriter Module

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:21:30

236 Views

XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs.Example# import xlsxwriter module import xlsxwriter # Workbook() takes one, non-optional, argument which is the filename #that we want to create. workbook = xlsxwriter.Workbook('chart_gradient1.xlsx') # The workbook object is then used to add new worksheet via the #add_worksheet() method. worksheet = workbook.add_worksheet() # Create a new Format object to formats cells in worksheets using #add_format() method . # here we create bold format object . bold = workbook.add_format({'bold': 1}) # Add the worksheet data that the charts will refer ... Read More

Number of Values Greater Than K in List using Python

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:14:09

794 Views

One of the basic problems for many complex problems is finding numbers greater than certain number in list in python, is commonly encountered.Example Live Demo# find number of elements > k using for loop # initializing list test_list = [1, 7, 5, 6, 3, 8] # initializing k k = 4 # printing list print ("The list : " + str(test_list)) # using for loop to get numbers > k count = 0 for i in test_list :    if i > k :       count = count + 1 # printing the intersection print ("The numbers greater than ... Read More

Python Implementation of Polynomial Regression

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:12:29

394 Views

Polynomial Regression is a form of linear regression in which the relationship between the independent variable x and dependent variable y is modeled as an nth degree polynomial. Polynomial regression fits a nonlinear relationship between the value of x and the corresponding conditional mean of y, denoted E(y |x)Example# Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset datas = pd.read_csv('data.csv') datas # divide the dataset into two components X = datas.iloc[:, 1:2].values y = datas.iloc[:, 2].values # Fitting Linear Regression to the dataset from sklearn.linear_model import LinearRegression lin = LinearRegression() lin.fit(X, y) ... Read More

Python Image Classification Using Keras

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:08:19

373 Views

Image classification is a method to classify the images into their respective category classes using some method like −Training a small network from scratchFine tuning the top layers of the model using VGG16Example#First, include following libraries: # Importing all necessary libraries from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from keras.layers import Conv2D, MaxPooling2D from keras.layers import Activation, Dropout, Flatten, Dense from keras import backend as K #Here, the train_data_dir is the train dataset directory. validation_data_dir is the #directory for validation data. nb_train_samples is the total number train #samples. nb_validation_samples is the total number of validation samples. img_width, img_height = 224, 224 train_data_dir = ... Read More

Feature Scaling in Python: How and Where to Apply

Nizamuddin Siddiqui
Updated on 06-Aug-2020 12:00:35

262 Views

It is a step of Data pre-processing which is applied to independent variables or features of data. It basically helps to normalise the data within a particular range.Why scaling?Most of the times, your dataset will contain features highly varying in magnitudes, units and range. But since, most of the machine learning algorithms use Euclidian distance between two data points in their computations, this is a problem.If left alone, these algorithms only take in the magnitude of features neglecting the units. The results would vary greatly between different units, 5kg and 5000gms.The features with high magnitudes will weigh in a lot ... Read More

Getting Started with SymPy Module in Python

Nizamuddin Siddiqui
Updated on 06-Aug-2020 11:54:41

734 Views

SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python. SymPy only depends on mpmath, a pure Python library for arbitrary floating point arithmetic, making it easy to use.#Installing sympy modulepip install sympySymPy defines following numerical types: Rational and Integer. The Rational class represents a rational number as a pair of two Integers, numerator and denominator, so Rational(1, 2) represents 1/2, Rational(5, 2) 5/2 and so on. The Integer class represents Integer number.SymPy ... Read More

Techniques Used in Financial Statement Analysis

Mandalika
Updated on 06-Aug-2020 08:30:43

730 Views

Financial statement analysis is interpreted mainly to determine the financial operational performances of the business concern. Following are the common techniques that are widely used −Comparative statement analysis − These statements help to understand the comparative position of financial and operational period at different period of time. It is again classified into 2 types −Comparative balance sheet analysis − As the name suggests, it only concentrates on balance sheet at different period of time. This type of analysis helps to understand the real financial position over the years and how well the organisation utilises its assets, liabilities and capitals during ... Read More

Sum of the Nodes of a Circular Linked List in C++

sudhir sharma
Updated on 06-Aug-2020 08:29:34

305 Views

In this problem, we are given a circular linked list. Our task is to create a program to find the sum of the nodes of a Circular Linked List.We simply need to add all the node values of the linked list.Some important definitions Linked List is a sequence of data structures, which are connected together via links.Circular Linked List is a variation of the Linked list in which the first element points to the last element and the last element points to the first element. Both Singly Linked List and Doubly Linked List can be made into a circular linked list.Now, let’s ... Read More

Sum of Natural Numbers Up to n Whose Modulo with k Yield r in C++

sudhir sharma
Updated on 06-Aug-2020 08:26:42

279 Views

In this problem, we are given three numbers N, K and R. Our task is to create a program to find the Sum of the natural numbers (up to N) whose modulo with K yield R.We will add all the numbers less than N that satisfy the following condition, i%K == R.Let’s take an example to understand the problem, Input N = 14, K = 4, R = 1Output 28Explanation − All the numbers less than N, that given 1 as remainder when divided by 4 are 1, 5, 9, 13.To solve this problem, we will loop from R to N, and ... Read More

Advertisements