In this tutorial, we are going to learn how to multiply two matrices using the NumPy library in Python. It's straightforward with the NumPy library.It has a method called dot for the matric multiplication. You can install the NumPy library with the following command.pip install numpyLet's see the steps involved in the program.Import the NumPy library.Initialize the matrices.Multiply the matrices with numpy.dot(matrix_1, matrix_2) method and store the result in a variable.Print the result.See the below code.Example# importing the module import numpy # initializing the matrices matrix_1 = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ... Read More
Given a list of numbers, move all the zeroes to the end using list comprehensions. For example, the result of [1, 3, 0, 4, 0, 5, 6, 0, 7] is [1, 3, 4, 5, 6, 7, 0, 0, 0].It's a single line code using the list comprehensions. See the following steps to achieve the result.Initialize the list of numbers.Generate non-zeroes from the list and generate zeroes from the list. Add both. And store the result in a list.Print the new list.Example# initializing a list numbers = [1, 3, 0, 4, 0, 5, 6, 0, 7] # moving all the zeroes ... Read More
In this tutorial, we are going to learn to merge, join, and concat the DataFrames using pandas library. I think you are already familiar with dataframes and pandas library. Let's see the three operations one by one.MergeWe have a method called pandas.merge() that merges dataframes similar to the database join operations. Follow the below steps to achieve the desired output. Merge method uses the common column for the merge operation.Initialize the Dataframes.Call the method pandas.merge() with three arguments dataframes, how (defines the database join operation), on (common field of the dataframes).ExampleLet's see an example.# importing the pandas library import pandas # creating dataframes ... Read More
Google provides a static maps API that returns a map image on our HTTP request. We can directly request for a map image with different parameters based on our need.We have to create a billing account on Google to use this API. You can go to the website for more details.Let's see the steps to get the image of a location.Import the requests module.Initialise your API Key and base URL ("https://maps.googleapis.com/maps/api/staticmap?").Initialize the city and zoom value.Update the URL with API Key, City, and Zoom value.USend an HTTP request. And write the response to a file for saving the image.pdate the ... Read More
In this tutorial, we are going to get the weather of a city using OpenWeatherMap API. To use the OpenWeatherMap API, we have to get the API key. We will get it by creating an account on their website.Create an account and get your API Key. It's free until 60 calls per minute. You have to pay if you want more than that. For this tutorial, the free version is enough. We need requests module for the HTTP requests and JSON module to work with the response. Follow the below steps to the weather of any city.Import the requests and JSON ... Read More
This error occurs when remote server doesn’t provide a response to your request and connection is broken before request is complete. To fix this issue, first setup a request that includes QaaWsHeader and ReportBlock configuration, then create the Request and in last using ServicesSoapClient, you can make method to send results.Check out the below code and it may help −Sellers.QaaWSHeader qaawsHeaderDatos = new Sellers.QaaWSHeader(); Sellers.GetReportBlock_WBS_Sellers getReportBlock = new Sellers.GetReportBlock_WBS_Sellers(); getReportBlock.login = userWS; getReportBlock.password = passWS; getReportBlock.refresh = true; getReportBlock.startRow = 0; getReportBlock.startRowSpecified = true; getReportBlock.endRow = 1000; getReportBlock.endRowSpecified = true; Sellers.GetReportBlock_WBS_Sellers_Request ... Read More
In this tutorial, we are going to write a program that finds the frequency of all the elements in an array. We can find it in different ways let's explore two of them.Using dictInitialize the array.Initialize an empty dict.Iterate over the list.If the element is not in dict, then set the value to 1.Else increment the value by 1.Print the element and frequencies by iterating over the dict.ExampleLet's see the code.# intializing the list arr = [1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3] # initializing dict to store frequency of each element elements_count = {} ... Read More
In this tutorial, we are going to write a program that counts and prints the words with a higher frequency of an alphabet than the second one.Take a string and two alphabets. The prefixes with a higher frequency of the first alphabet will be printed. And display the count at the end of the output.Let's see some examples.Inputstring:- apple alphabets:- p, eOutputap app appl apple 4Inputstring:- apple alphabets:- e, pOutput0Let's see the steps to write the code.Define a function and write the code in it.Initialize count to 0 and an empty string.Iterate over the string.Get the prefix using the string ... Read More
jQuery is a JavaScript library introduced to make development with JavaScript easier. It reduces the development time. Let us see how to call a jQuery plugin function outside the plugin.For calling, wrap the jQuery method for returning the instance of the constructor. Call prototype methods on it.example$.fn.myFunction = function(config){ return new myFunction (config); };Instance the plugin and call the method −var plugin = $('#someSelector').myFunction(); plugin.setToken(column);
It is not possible. Check this link for details:ABAP DocumentationThe correct way for using “VALUE” with elementary data type is by assigning initial value and you should use NEW operator to assign initial value.DATA(l_value) = NEW char4( 'AAA' ).
 Data Structure
 Networking
 RDBMS
 Operating System
 Java
 iOS
 HTML
 CSS
 Android
 Python
 C Programming
 C++
 C#
 MongoDB
 MySQL
 Javascript
 PHP