Found 10476 Articles for Python

Copy list with random Pointer in Python

Dev Prakash Sharma
Updated on 23-Feb-2021 19:03:40

766 Views

A Linked List is a linear data structure in which each node is having two blocks such that one block contains the value or data of the node and the other block contains the address of the next field.Let us assume that we have a linked list such that each node contains a random pointer which is pointing to other nodes in the list. The task is to construct the list with the same as the original list. Copying the list from the original list which is having some random pointer is called a 'Deep Copy' of the linked list.For ... Read More

Breadth First Search on Matrix in Python

Dev Prakash Sharma
Updated on 23-Feb-2021 05:37:17

2K+ Views

In a given matrix, there are four objects to analyze the element position: left, right, bottom, and top.Breadth First Search is nothing but finding the shortest distance between the two elements of a given 2-D Matrix. Thus, in each cell, there are four operations we can perform which can be expressed in four numerals such as, '2' describes that the cell in the matrix is Source.'3' describes that the cell in the matrix is Destination.'1' describes that the cell can be moved further in a direction.'0' describes that the cell in the matrix can not be moved in any direction.On ... Read More

Balanced Binary Tree in Python

Dev Prakash Sharma
Updated on 23-Feb-2021 19:08:10

5K+ Views

In a binary tree, each node contains two children, i.e left child and right child. Let us suppose we have a binary tree and we need to check if the tree is balanced or not. A Binary tree is said to be balanced if the difference of height of left subtree and right subtree is less than or equal to '1'.ExampleInput-1: Output:TrueExplanation:The given binary tree is [1, 2, 3, NULL, NULL, 6, 7]. The height difference of its left subtree and right subtree is equal to '1', thus it is a height Balanced tree.Input-2:               Output:FalseExplanation:The given ... Read More

What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?

AmitDiwan
Updated on 19-Feb-2021 08:59:18

482 Views

Tensorflow is a machine learning framework that is provided by Google. It is an open-source framework used in conjunction with Python to implement algorithms, deep learning applications and much more.TensorFlow is used in research and for production purposes and has optimization techniques that help in performing complicated mathematical operations quickly. This is because it uses NumPy and multi-dimensional arrays. These multi-dimensional arrays are also known as ‘tensors’. The framework supports working with deep neural network. It is highly scalable, and comes with many popular datasets. It uses GPU computation and automates the management of resources. It comes with multitude of ... Read More

Python Pandas - Read data from a CSV file and print the ‘product’ column value that matches ‘Car’ for the first ten rows

Vani Nalliappan
Updated on 17-Feb-2021 06:26:32

924 Views

Assume, you have ‘products.csv’ file and the result for a number of rows and columns and ‘product’ column value matches ‘Car’ for the first ten rows are −Download the products.csv file here.Rows: 100 Columns: 8 id    product    engine    avgmileage    price    height_mm    width_mm    productionYear 1 2    Car       Diesel       21         16500       1530          1735         2020 4 5    Car         Gas        18         17450   ... Read More

How can Tensorflow be used to compose layers using Python?

AmitDiwan
Updated on 25-Feb-2021 15:21:51

230 Views

Tensorflow can be used to compose layers by defining a class that inherits from ‘ResnetIdentityBlock’. This is used to define a block which can be used to compose the layers.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?A neural network that contains at least one layer is known as a convolutional layer. We can use the Convolutional Neural Network to build learning model. TensorFlow Hub is a repository that contains pre-trained TensorFlow models. TensorFlow can be used to fine-tune learning models. We will understand how to use models from TensorFlow Hub with tf.keras, use an ... Read More

How can Tensorflow be used to plot the results using Python?

AmitDiwan
Updated on 25-Feb-2021 14:57:25

406 Views

Tensorflow can be used to plot the results using the ‘matplotlib’ library and ‘imshow’ method.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?A neural network that contains at least one layer is known as a convolutional layer. We can use the Convolutional Neural Network to build learning model. The intuition behind transfer learning for image classification is, if a model is trained on a large and general dataset, this model can be used to effectively serve as a generic model for the visual world. It would have learned the feature maps, which means the user ... Read More

How can Tensorflow be used to check the predictions using Python?

AmitDiwan
Updated on 25-Feb-2021 14:56:07

375 Views

Tensorflow be used to check the predictions using the ‘predict’ method and the ‘argmax’ method present in Numpy package.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?A neural network that contains at least one layer is known as a convolutional layer. We can use the Convolutional Neural Network to build learning model. The intuition behind transfer learning for image classification is, if a model is trained on a large and general dataset, this model can be used to effectively serve as a generic model for the visual world. It would have learned the feature maps, ... Read More

How can Tensorflow be used to visualize the loss versus training using Python?

AmitDiwan
Updated on 25-Feb-2021 14:44:48

275 Views

Tensorflow can be used to visualize the loss versus training using the ‘matplotlib’ library and ‘plot’ method to plot the data.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?A neural network that contains at least one layer is known as a convolutional layer. We can use the Convolutional Neural Network to build learning model. The intuition behind transfer learning for image classification is, if a model is trained on a large and general dataset, this model can be used to effectively serve as a generic model for the visual world. It would have learned the ... Read More

How can Tensorflow be used to fit the data to the model using Python?

AmitDiwan
Updated on 25-Feb-2021 14:43:34

221 Views

Tensorflow can be used to fit the data to the model using the ‘fit’ method.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?A neural network that contains at least one layer is known as a convolutional layer. We can use the Convolutional Neural Network to build learning model. The intuition behind transfer learning for image classification is, if a model is trained on a large and general dataset, this model can be used to effectively serve as a generic model for the visual world. It would have learned the feature maps, which means the user ... Read More

Advertisements