Bar Plot in Seaborn is used to show point estimates and confidence intervals as rectangular bars. The seaborn.barplot() is used for creating horizontal bar plots.Let’s say the following is our dataset in the form of a CSV file − Cricketers2.csvAt first, import the required libraries −import seaborn as sb import pandas as pd import matplotlib.pyplot as pltLoad data from a CSV file into a Pandas DataFrame −dataFrame = pd.read_csv("C:\Users\amit_\Desktop\Cricketers2.csv") Plotting horizontal bar plots −sb.barplot(x = "Matches", y = "Academy", data= dataFrame)ExampleFollowing is the code −import seaborn as sb import pandas as pd import matplotlib.pyplot as plt # Load data ... Read More
In this article, we will see how to use a different type of light in react-three-fiber to make our objects look better. It will mainly act as a torch light that point toward an object. Three.js needs light to show colors, shadow effect, and many different kinds of effects.We will make a cube and then we will add the pointer light to it.ExampleFirst of all, install the following packages −npm i --save @react-three/fiber threethreejs and react-three/fiber will be used to add webGL renderer to the website and three-fiber will be used to connect threejs and ReactNow, insert the following lines ... Read More
Bar Plot in Seaborn is used to show point estimates and confidence intervals as rectangular bars. The seaborn.barplot() is used for this. Plotting vertical bar plots grouped by a categorical variable, by passing categorical variables using x, y or hue parameter.Let’s say the following is our dataset in the form of a CSV file − Cricketers2.csvAt first, import the required libraries −import seaborn as sb import pandas as pd import matplotlib.pyplot as pltLoad data from a CSV file into a Pandas DataFrame −dataFrame = pd.read_csv("C:\Users\amit_\Desktop\Cricketers2.csv") Plotting vertical bar plots grouped by two categorical variables. The hue parameter also setsb.barplot(x = ... Read More
In this article, we will see how to create a PDF using React JS. PDFs are versatile document formats which are used for various purposes like reporting, data sharing, data storage, etc. It is really a great help if we can a PDF in React through simple CSS.ExampleFirst create a React app −npx create-react-app pdfviewerInstall the react-pdf packagenpm i @react-pdf/renderer We will use this package to create a PDF inside our React frontend using DOM elements and CSS.Insert the following piece of code in in App.js −import React from "react"; import { Document, Page, Text, View, ... Read More
In this article, we will see how to render a page according to device but without using if-else clause. For this, we will use the react-device-detect package. This feature can help us create responsive webpages without using any media queries. So, let's get started.ExampleFirst create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurpose Download the react-device-detect package −npm install react-device-detect --saveWe will use this package to add default media queries or default conditional rendering which are premade inside the package.Add the following lines of code in App.js −import { BrowserView, ... Read More
Append a list of dictionaries to an existing Pandas DataFrame, use the append() method. At first, create a DataFrame −dataFrame = pd.DataFrame( { "Car": ['BMW', 'Audi', 'XUV', 'Lexus', 'Volkswagen'], "Place": ['Delhi', 'Bangalore', 'Pune', 'Chandigarh', 'Mumbai'], "Units": [100, 150, 50, 110, 90] } ) Create list of Dictionaries − d = [{'Car': 'Mustang', 'Place': 'Hyderabad', 'Units': 60}, {'Car': 'Tesla', 'Place': 'Kerala', 'Units': 30}, {'Car': 'RollsRoyce', 'Place': 'Punjab', 'Units': 70}, {'Car': 'Bentley', 'Place': 'Gujarat', 'Units': 80} ] Now, append list of Dictionaries to an already created DataFrame −dataFrame = dataFrame.append(d, ignore_index=True, ... Read More
In this article, we will see how to make a metallic texture cubic box in React JS using React-Three-Fiber package. First, we will download a metallic photo and then we will apply it over all the surfaces of a cube. Cubes are basic shapes but we can make them look attractive by wrapping an image over its surfaces. So, let's get start.ExampleFirst download and install the following packages −npm i --save @react-three/fiber threethreejs and react-three/fiber will be used to add webGL renderer to the website and three-fiber will be used to connect threejs and React.Now let's download a metallic image ... Read More
Drag and Drop interfaces enable web applications to allow users to drag and drop files on a web page. In this article, we will see how an application can accept one or more files that are dragged from the underlying platform's file manager and dropped on a web page. Here, we will be using the react-dropzone package. Let's get started.ExampleFirst of all, create a React project −npx create-react-app newprojectGo to the project directory −cd newproject Now download and install the react-dropzone package −npm i --save react-dropzoneWe will use this library to add a droppable area inside our React element's area. ... Read More
In this article, we will see how to draw flowchart-like arrows to connect different DOM elements in React JS. You can use this feature to create a unique web design. Here we will use the react-archer package to draw arrows to connect the DOM elements.A DOM element is something like a DIV, HTML, BODY element on a page. You can add classes to all of these using CSS, or interact with them using JS.ExampleFirst create a React project −npx create-react-app tutorialpurposeNow go to the project directory −cd tutorialpurposeDownload and install the react-archer package −npm install react-archerWe will use the react-archer ... Read More
Use the colDrop() method of pdpipe library to remove a column from Pandas DataFrame. At first, import the required pdpipe and pandas libraries with their respective aliases −import pdpipe as pdp import pandas as pdLet us create a DataFrame. Here, we have two columns −dataFrame = pd.DataFrame( { "Car": ['BMW', 'Lexus', 'Audi', 'Mustang', 'Bentley', 'Jaguar'], "Units": [100, 150, 110, 80, 110, 90] } )To remove a column from the DataFrame, use the ColDrop() method. Here, we are removing the “Units” column −resDF = pdp.ColDrop("Units").apply(dataFrame) ExampleFollowing is the complete code − import pdpipe as ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP