World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITian's, only for AI Learners.
Download our e-book of Introduction To Python
4 (4,001 Ratings)
218 Learners
Neha Kumawat
5 months ago
import numpy as np
arr = np.array([[4, 6], [7, 8]])
print(arr)
[[4 6]
[7 8]]
import numpy as np
arr = np.array([1, 2, 3, 4, 5], ndmin = 2)
print(arr)
[[1 2 3 4 5]]
import numpy as np
arr = np.array([1, 2, 3], dtype = complex)
print(arr)
[1.+0.j 2.+0.j 3.+0.j]
import pandas as pd
import numpy as np
data = np.array(['P','Q','R','S'])
series = pd.Series(data)
print(series)
0 P
1 Q
2 R
3 S
dtype: object
import
pandas as pd
data =
{'Name':['Ram', 'Mohan', 'Amit', 'Ricky'],'Age':[23,25,29,36]}
df1 =
pd.DataFrame(data, index=['rank1','rank2','rank3','rank4'])
print(df1)
Name Age
rank1 Ram 23
rank2 Mohan 25
rank3 Amit 29
rank4 Ricky 36