I have a csv which I have imported using the following script
import pandas as pd
data = pd.read_csv("filen__new.csv")
data.head()
I wish to know the type of each column (ie whether its numerical, boolean or any other type)
When I do data.info()
I get
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 200009 entries, 0 to 200008
Columns: 151 entries, iterator to parse168
dtypes: float64(149), int64(1), object(1)
Is there a better way to get the type of each of the columns along with column name: for eg something that indicates my column 1 name is iterator and its type as numeric/float & name of column2 is parse1 and its type is boolean
I also was looking to generate unique and max values of each of columns and use the code for each of my column names
## for unique values for each column
uniqueValues = data['iterator'].unique()
print('Unique elements in column "iterator" ')
print(uniqueValues)
###printing the max value of column1
column1 = data["iterator"]
max_value = column1.max()
print(max_value)
If i have 150 columns I have to repeat this 150 times. is there a way i could do this better?