Python Pandas – How to use Pandas DataFrame tail( ) function

Vani Nalliappan
Published on 27-Feb-2021 15:19:15
Write a Python code to find price column value between 30000 to 70000 and print the id and product columns of the last three rows from the products.csv file.Download the products.csv file here.Result for price column value between 30000 to 70000 and id and product columns last three rows are −  ... Read More

Python Pandas – How to use Pandas DataFrame Property: shape

Vani Nalliappan
Published on 27-Feb-2021 11:20:10
Write a Python program to read data from the products.csv file and print the number of rows and columns. Then print the ‘product’ column value matches ‘Car’ for first ten rowsAssume, you have ‘products.csv’ file and the result for number of rows and columns and ‘product’ column value matches ‘Car’ ... Read More

Checking if a string can be made palindrome in JavaScript

AmitDiwan
Published on 27-Feb-2021 10:46:59
We are required to write a JavaScript function that takes in a string as the first and the only argument.The task of our function is to check whether we can make that string a palindrome string by deleting at most one character from the string. If we can do so, ... Read More

Finding n most frequent words from a sentence in JavaScript

AmitDiwan
Published on 27-Feb-2021 10:44:03
For the purpose of this question, we define a sentence as a string that contains English alphabets and punctuations and a word is a substring of that sentence joined together by whitespaces.We are required to write a JavaScript function that takes in a sentence string, str, as the first argument ... Read More

Can array be divided into n partitions with equal sums in JavaScript

AmitDiwan
Published on 27-Feb-2021 10:41:47
We are required to write a JavaScript function that takes in an array of numbers, arr, as the first argument and a number, num, as the second argument.The function should determine whether there exists a way of distributing the elements of the array arr into num groups such that all ... Read More

Counting all possible palindromic subsequence within a string in JavaScript

AmitDiwan
Published on 27-Feb-2021 10:39:21
Palindrome Sequence:A string sequence is known as palindrome sequence if it reads the same from front and the back. For instance, 'aba', 'madam, 'did' are all valid palindrome sequences.We are required to write a JavaScript function that takes in a string as the first and the only argument. The string ... Read More

Find Smallest Letter Greater Than Target in JavaScript

AmitDiwan
Published on 27-Feb-2021 10:36:39
Suppose we are given an array of sorted characters letters containing only lowercase letters. And given a target letter target.We are required to write a JavaScript function that takes in the array as the first argument and the letter as the second. The function is supposed to find the smallest ... Read More

Finding all valid word squares in JavaScript

AmitDiwan
Published on 27-Feb-2021 10:35:00
Word Square:A word square consists of a set of words written out in a square grid, such that the same words can be read both horizontally and vertically.For instance, once valid word square is −H E A R T E M B E R A B U S E R ... Read More

Finding gcd of two strings in JavaScript

AmitDiwan
Published on 27-Feb-2021 10:32:56
In the number system, the Greatest Common Divisor (GCD) of two numbers is that greatest number which divides both the numbers. Similarly, if we apply this concept to strings, the gcd of two strings is the greatest substring (greatest in length) that is present in both the strings.For example −If ... Read More

Checking digit sum of smallest number in the array in JavaScript

AmitDiwan
Published on 27-Feb-2021 10:31:08
We are required to write a JavaScript function that takes in an array of numbers as the first and the only argument. The function should first pick the smallest number from the array and then calculate the sum of all the digits of the number.If the digit sum of that ... Read More
1 2 3 4 5 6 7 ... 4562 Next
Advertisements