forked from vglug/ProgrammingLogic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpandas_dataframe.py
More file actions
34 lines (20 loc) · 875 Bytes
/
pandas_dataframe.py
File metadata and controls
34 lines (20 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#Pandas helps you to managae two-dimension data tables in python.
#Frist import the pandas library.
import pandas as pd
dict = {"dept":["IT","CSE","ECE","MECH"],
"students":["210","220","230","400"],
"staff":["5","7","8","14"]}
#Using this DataFrame funcion the data are displayed as table.
Clg_det = pd.DataFrame(dict)
print(Clg_det)
#Another way to create a DataFrame by import csv file using pandas.
#To import the csv file by Using the read_csv() function.
Student_list = pd.read_csv('stu_list.csv')
print(Student_list)
#TO get total number of column and row of the table using shape() function.
clg_det.shape
#To get the statistical about the numerical column in a dataset using describe.
clg_det.describe()
#To concatenate the two datasets into one using concat() function.
clg_det = pd.concat([Student_list,Staff_list])
print(clg_det)