Create Slider Carousel with CSS Flexbox

AmitDiwan
Updated on 10-Feb-2021 13:23:13

2K+ Views

We can create an infinitely scrolling slider using CSS Flexbox with the help of JavaScript.ExampleThe following examples illustrate carousel using CSS. Live Demo                    img {             width: 100%;          }          .container {             max-width: 600px;             position: relative;             margin: 6% auto;          }          .prevbtn, .nextbtn {             position: absolute;   ... Read More

Create a Comment Box with Containing Text Using CSS

AmitDiwan
Updated on 10-Feb-2021 13:05:31

627 Views

Comment box can be created using clip-path propertySyntaxThe syntax of CSS clip-path property is as follows −Selector {    clip-path: /*value*/ }ExampleThe following examples show how we can create a comment box using CSS. Live Demo                    .cb {             position: relative;             padding: 2%;             border-radius: 8%;             width:25%;          }          .cb::after {             content: "";     ... Read More

Count Special Characters in Words Using Python Pandas

Vani Nalliappan
Updated on 10-Feb-2021 12:39:30

646 Views

Input − Assume you have a series, 0       fruits!! 1       *cakes* 2       $nuts 3       #drinks dtype: objectInput − The result for the total number of counts for more than one special character in a series is 2.Let us try to find different solutions to this question.Solution 1To solve this, we will follow the steps given below −Define a SeriesCreate special characters list of values.Set the initial value of special character and total special char count value as 0.Create a for loop and access all the values in the ... Read More

Create Combination of Multiple Vectors in R

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:21:59

3K+ Views

To create combination of multiple vectors, we can use expand.grid function. For example, if we have six vectors say x, y, z, a, b, and c then the combination of vectors can be created by using the command expand.grid(x,y,z,a,b,c).Example Live Demox1

Check If a Word Exists in an R Data Frame Column

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:14:09

824 Views

If we have a character column in an R data frame then we might want to check whether a particular value exist in the column or not. For example, if we have a gender column then we might want to check whether transgender exists in that column or not. This can be done with the help of grepl function. Check out the below examples to understand how it works.Consider the below data frame −Example Live Demox

Extract Statistical Summary from Boxplot in R

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:12:07

8K+ Views

To extract statistical summary from boxplot we can use stats function with delta operator. For example, if we have a data frame called df that contains 5 columns then the boxplot for each column can be created by using the command boxplot(df) and if we want to extract the statistical summary from this boxplot then boxplot(df)$stats can be used.Consider the below data frame −Example Live Demodf

Extract Strings Containing a Particular Substring in R Vector

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:06:39

1K+ Views

Suppose we have a vector that contains multiple string elements and we want to find out which string element has a particular substring. This can be done with the help of grep function. For example, if we have a vector called x that contains five string elements each of varying length then finding which of the elements has a substring say programming then it can be done by using the command grep("programming",x,fixed=TRUE)Example Live Demox1

Put Space Between Uppercase Words in String Vector in R

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:02:06

2K+ Views

To put space between words that start with uppercase letter in string vector in R, we can use gsub function. Since we can have uppercase letters as well as lowercase letters in the string vector hence, we need to properly specify both type of characters for creating the space between words. Check out the below examples to understand how it works.Example Live Demox1

Truncate String Vector After a Character in R

Nizamuddin Siddiqui
Updated on 10-Feb-2021 11:00:30

1K+ Views

The most difficult problem in data analysis is cleaning a dirty data. Most of the times the data is available in dirty form and one such dirtiness is a string vector having unnecessary values after a particular character. Therefore, to truncate a string vector after a character we can use str_split from stringr package along with the sapply function as shown in the below examples.library(stringr)Example Live Demox1

Display Y-Axis with Euro Sign using ggplot2 in R

Nizamuddin Siddiqui
Updated on 10-Feb-2021 10:59:12

1K+ Views

When we have a Euro currency column in an R data frame as a response variable then we might to display the Euro sign in the plot created by using ggplot2 package. For this purpose, we can use scales package and the scale for Y axis will be changed by using the command scale_y_continuous(labels=dollar_format(suffix="€",prefix="")) to the plot command.Consider the below data frame −Example Live Demox

Advertisements