Оба столбца на графике не имеют числового типа, однако директивы
(.env) boris@boris-All-Series:~/MATPLOTLIBSR/TENSOR$ cat SortedPandasD1.py
# importing package
import pandas as pd
# Creating a dataframe that stores records of students taking admission in a college
data = pd.DataFrame({'AdmissionDate': ['2021-01-25','2021-01-22','2021-01-20',
'2021-01-18','2021-01-22','2021-01-17','2021-01-21'],
'StudentID': [7,5,3,2,6,1,4],
'Name': ['Ram','Shyam','Mohan','Sohan','Lucky','Abhinav','Danny'],
'Stream':['CSE','ECE','Civil','Mechanical','CSE','IT','EEE']
})
# Checking dataframe
print(data)
print('\n')
dfs = data.sort_values(by='AdmissionDate', ascending=True)
print(dfs)
(.env) boris@boris-All-Series:~/MATPLOTLIBSR/TENSOR$ python3 SortedPandasD1.py
AdmissionDate StudentID Name Stream
0 2021-01-25 7 Ram CSE
1 2021-01-22 5 Shyam ECE
2 2021-01-20 3 Mohan Civil
3 2021-01-18 2 Sohan Mechanical
4 2021-01-22 6 Lucky CSE
5 2021-01-17 1 Abhinav IT
6 2021-01-21 4 Danny EEE
AdmissionDate StudentID Name Stream
5 2021-01-17 1 Abhinav IT
3 2021-01-18 2 Sohan Mechanical
2 2021-01-20 3 Mohan Civil
6 2021-01-21 4 Danny EEE
1 2021-01-22 5 Shyam ECE
4 2021-01-22 6 Lucky CSE
0 2021-01-25 7 Ram CSE
No comments:
Post a Comment