10 Essential Python Libraries for Data Science in 2023

Python is a popular programming language in the field of data science and data analytics due to its simplicity and versatile applications. Its vast community of developers provides ample support and resources for users to tackle any issues they may face. Here are the 10 essential Python libraries for data science in 2023: NumPy: This … Continue reading 10 Essential Python Libraries for Data Science in 2023

Import csv in Python [Jupyter]

In this we discussed how to import csv in python and get first 5 rows from csv and save it on another sheet. import pandas as pd #Read the CSV filedf = pd.read_csv('annual-enterprise-survey-2021-financial-year-provisional-csv.csv') #Select the first 10 rowsdf_subset = df.head(5) display(df) #Save the selected rows to a new CSV filedf_subset.to_csv('First-5-Rows.csv', index=False)

Display Bar Graph in Python [Jupyter]

import pandas as pdimport matplotlib.pyplot as plt #Read the CSV file into a DataFramedf = pd.read_csv('First-5-Rows.csv') #Group the data by 'Variable_name' and aggregate the 'Value' column by sumgrouped_df = df.groupby('Variable_name')['Value'].sum().reset_index() #Create a bar chart of the dataplt.bar(grouped_df['Variable_name'], grouped_df['Value']) #Add labels and title to the chartplt.xlabel('Variable Name')plt.ylabel('Value')plt.title('Bar Chart of First 5 Rows by Variable Name') Show … Continue reading Display Bar Graph in Python [Jupyter]