
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10476 Articles for Python

2K+ Views
Box Plot in Seaborn is used to draw a box plot to show distributions with respect to categories. The seaborn.boxplot() is used for this. Use the "orient” parameter for orientation of each numeric variable.Let’s say the following is our dataset in the form of a CSV file − Cricketers.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\Cricketers.csv")Plotting box plot using the orient parameter for orientation of each numeric variable −sb.boxplot( data = dataFrame, orient="h")ExampleFollowing is the code −import seaborn ... Read More

2K+ Views
We will group Pandas DataFrame using the groupby(). Select the column to be used using the grouper function. We will group year-wise and calculate sum of Registration Price with year interval for our example shown below for Car Sale Records.At first, let’s say the following is our Pandas DataFrame with three columns −# dataframe with one of the columns as Date_of_Purchase dataFrame = pd.DataFrame( { "Car": ["Audi", "Lexus", "Tesla", "Mercedes", "BMW", "Toyota", "Nissan", "Bentley", "Mustang"], "Date_of_Purchase": [pd.Timestamp("2021-06-10"), pd.Timestamp("2019-07-11"), pd.Timestamp("2016-06-25"), pd.Timestamp("2021-06-29"), ... Read More

3K+ Views
Bar Plot in Seaborn is used to show point estimates and confidence intervals as rectangular bars. The seaborn.barplot() is used for this. Display Standard Deviation of Observations using confidence interval ci parameter value sd.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 bar plot with Academy and Matches. Display Standard Deviation of Observations using confidence interval parameter value "sd" −sb.barplot(x = "Academy", y = ... Read More

906 Views
To select a subset of rows and columns, use the loc. Use the index operator i.e. the square bracket and set conditions in the loc.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")Select a subset of rows and columns combined. Right column displays the column you want to display i.e. Cars column here −dataFrame.loc[dataFrame["Units"] > 100, "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") ... Read More

481 Views
Point Plot in Seaborn is used to show point estimates and confidence intervals using scatter plot glyphs. The seaborn.pointplot() is used for this. For explicit order, use the order parameter of the pointplot() method.Let’s say the following is our dataset in the form of a CSV file − Cricketers.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\Cricketers.csv")Plotting point plot with “Academy” and “Age”. Control order by passing an explicit order i.e. ordering on the basis of "Academy". Ordering using ... Read More

518 Views
Point Plot in Seaborn is used to show point estimates and confidence intervals using scatter plot glyphs. The seaborn.pointplot() is used for this. To avoid drawing lines to connect points, simply set the “join” parameter of the pointplot() method to False.Let’s say the following is our dataset in the form of a CSV file − Cricketers.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\Cricketers.csv")Now, plot the Horizontal point plot. The “join” parameter is set as False to avoid drawing ... Read More

3K+ Views
To create a Time Series Plot with multiple columns using Line Plot, use the lineplot(). At first, import the required libraries −import seaborn as sb import pandas as pd import matplotlib.pyplot as pltCreate a DataFrame. We have multiple columns in our DataFrame −dataFrame = pd.DataFrame({'Date_of_Purchase': ['2018-07-25', '2018-10-25', '2019-01-25', '2019-05-25', '2019-08-25', '2020-09-25', '2021-03-25'], 'Units Sold': [98, 77, 51, 70, 70, 87, 76], 'Units Returned' : [60, 50, 40, 57, 62, 51, 60] })Plot time series plot for multiple columns −sb.lineplot(x="Date_of_Purchase", y="Units Sold", data=dataFrame) sb.lineplot(x="Date_of_Purchase", y="Units Returned", data=dataFrame)ExampleFollowing is the code −import seaborn as sb import pandas as pd import matplotlib.pyplot as ... Read More

199 Views
Horizontal point plots are a plotting based on the values of x and y i.e. the columns of the dataset you consider. Point Plot in Seaborn is used to show point estimates and confidence intervals using scatter plot glyphs. The seaborn.pointplot() is used for this.Let’s say the following is our dataset in the form of a CSV file − Cricketers.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\Cricketers.csv")Now, use the pointplot() and set the x and y values −sb.pointplot(x ... Read More

147 Views
To apply the aggregation list, use the agg() method. At first, import the required library −import pandas as pdCreate a DataFrame with two columns −dataFrame = pd.DataFrame( { "Car": ['BMW', 'Lexus', 'Lexus', 'Mustang', 'Bentley', 'Mustang'], "Units": [100, 150, 110, 80, 110, 90] } )Specifying list as argument using agg() −dataFrame = dataFrame.groupby('Car').agg(list) ExampleFollowing is the complete code −import pandas as pd # Create DataFrame dataFrame = pd.DataFrame( { "Car": ['BMW', 'Lexus', 'Lexus', 'Mustang', 'Bentley', 'Mustang'], "Units": [100, 150, 110, 80, 110, 90] } ) ... Read More

201 Views
Point Plot in Seaborn is used to show point estimates and confidence intervals using scatter plot glyphs. The seaborn.pointplot() is used for this. For vertical point plot grouped by a categorical variable, set the variable as a value for the pointplot().Let’s say the following is our dataset in the form of a CSV file − Cricketers.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\Cricketers.csv") Vertical point plot grouped by a categorical variable −sb.pointplot(dataFrame['Role'], dataFrame['Age'])ExampleFollowing is the code −import seaborn ... Read More