To select a subset of rows, use conditions and fetch data.Let’s say the following are the contents of our CSV file opened in Microsoft Excel −At first, load data from a CSV file into a Pandas DataFrame −dataFrame = pd.read_csv("C:\Users\amit_\Desktop\SalesData.csv")Let’s say we want the Car records with “Units” more than 100 i.e. subset of rows. For this, use −dataFrame[dataFrame["Units"] > 100] Now, let’s say we want the Car records with “Reg_Price” less than 100 i.e. subset of rows. For this, use −dataFrame[dataFrame["Reg_Price"] < 3000]ExampleFollowing is the code − import pandas as pd # Load data from a CSV file ... Read More
Let’s say the following are the contents of our CSV file opened in Microsoft Excel −At first, load data from a CSV file into a Pandas DataFrame −dataFrame = pd.read_csv("C:\Users\amit_\Desktop\SalesData.csv")To select a subset, use the square brackets. Mention the column in the brackets and fetch single column from the entire dataset −dataFrame['Car'] ExampleFollowing is the code − import pandas as pd # Load data from a CSV file into a Pandas DataFrame dataFrame = pd.read_csv("C:\Users\amit_\Desktop\SalesData.csv") print("Reading the CSV file...", dataFrame) # displaying only a single column res1 = dataFrame['Car']; # displaying only a subset print("Displaying only one column ... Read More
To plot a DataFrame in a Line Graph, use the plot() method and set the kind parameter to line. Let us first import the required libraries −import pandas as pd import matplotlib.pyplot as mpFollowing is our data with Team Records −data = [["Australia", 2500, 2021], ["Bangladesh", 1000, 2021], ["England", 2000, 2021], ["India", 3000, 2021], ["Srilanka", 1500, 2021]]Set the data as Pandas DataFrame and add columns −dataFrame = pd.DataFrame(data, columns=["Team", "Rank_Points", "Year"]) Plot the Pandas DataFrame in a line graph. We have set the “kind” parameter as “line” for this −dataFrame.plot(x="Team", y=["Rank_Points", "Year" ], kind="line", figsize=(10, 9))ExampleFollowing is the code −import ... Read More
To find unique values from multiple columns, use the unique() method. Let’s say you have Employee Records with “EmpName” and “Zone” in your Pandas DataFrame. The name and zone can get repeated since two employees can have similar names and a zone can have more than one employee. In that case, if you want unique Employee names, then use the unique() for DataFrame.At first, import the required library. Here, we have set pd as an alias −import pandas as pdAt first, create a DataFrame. Here, we have two columns −dataFrame = pd.DataFrame( { "EmpName": ['John', 'Ted', ... Read More
In this article, we will see how to implement a Lottie animation in a React Native app. Lottie is an open source animation file format that’s tiny, high quality, interactive, and can be manipulated at runtime. Lottie animations are mainly used for loader screen or as a start screen.So, let's add a Lottie animation to our React Native mobile app.ExampleGo to the official Lottie animation website and download Lottie JSON.Link to animation that I am going to use −https://lottiefiles.com/74546-character-02# /Name the JSON file "myloader.json" and keep it at the same level as App.js.Now install the lottie-react-native packagenpm i --save lottie-react-nativeLottie ... Read More
In this article, we will see how to create a QR code of a link in React JS. A QR code is a two-dimensional barcode that is readable on smartphones. You must have seen QR codes on websites that you can scan which redirects you to a page. For example, to access WhatsApp from your laptop, you can go to "web.whatsapp.com" and then open WhatsApp on your phone and scan the given QR code.ExampleFirst create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeInstall the qrcode.react package −npm i --save qrcode.reactThis library is going to help us ... Read More
In this article, we will see how to create a Sky shader in React JS using React-Three-Fiber. It will appear to look like original sky and it is really a great effect. Three.js is a cross-browser JavaScript library and application programming interface used to create and display animated 3D computer graphics in a web browser using WebGLExampleFirst install the following packages −npm i --save @react-three/fiber npm i --save @react-three/dreireact-three/fiber will be used as an intermediate between threejs and React.js and drei will be used to implement premade optimizable sky effect in it.Now, insert the following piece of code in App.js ... Read More
In this article, we will see how to create animated loading skeletons in React JS. We get to see animated loading skeletons on eCommerce sites and travel sites where they are used to indicate what type of content we are going to see once the page loads. It is popular among developer community. So, let's get started.First create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeExample 1Install the react-loading-skeleton package −npm i --save react-loading-skeletonWe will use this package to implement premade skeleton loading in our React or Node project without any CSS or JavaScript.Add the following ... Read More
SVG morphing is quite useful where you can morph SVG images with a beautiful animation which will look really great. It is a technique to give a transition between two SVG images when one SVG changes to another SVG.First create a React project −npx create-react-app tutorialpurposeGo to the project directory −cd tutorialpurposeExampleDownload and install the react-svg-morph package −npm install react-svg-morph --saveThis package will allow us to implement premade morphing animation to our SVGs.Add the following lines of code in App.js −import React from "react"; import ReactDOM from "react-dom"; import { MorphReplace } from "react-svg-morph"; class Checked extends React.Component { ... Read More
Let’s say the following are the contents of our CSV file − Car Reg_Price 0 BMW 2000 1 Lexus 1500 2 Audi 1500 3 Jaguar 2000 4 Mustang 1500Import the required libraries −import pandas as pd import matplotlib.pyplot as mpOur CSV file is on the Desktop. Load data from a CSV file into a Pandas ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP