DA2_using-matplotlib
DA2_using-matplotlib
Code:-
import pandas as pd
import numpy as np
df = pd.read_csv("gap-every-five-years(1).csv")
df
df.head()
sub_1 = df[['country','year','lifeExp','pop']].head(14)
sub_1.dtypes
sub_1
sub_1['lifeExp'] = np.log(sub_1['lifeExp'])
sub_1.to_csv("Sanchit_exp2.csv",index=False)
sub_1.head()
arr_1 = np.array([1,2,3,4,5,6,7,8,9,10,11,12,13,14])
arr_2 = np.random.rand(3,4)
print(arr_1)
print(arr_2)
arr_1_form = arr_1.shape
arr_2_form = arr_2.shape
print("The Representation of the 1 Dimensional Array is:-",arr_1_form)
print("The Representation of the 2 Dimensional Array is:-",arr_2_form)
arr_1_part = arr_1[:5]
arr_2_part = arr_2[1,2]#taking the 2nd Row and 3rd Column[row-1,column-1]
print("The Subset of Array 1 is:-",arr_1_part)
print("The Subset of Array 2 is:-",arr_2_part)
arr_3 = arr_1+5
arr_4 = arr_2*10
Output:-
#Transfering Data to new CSV file ^
Array Operations:-