0 votes
1 view
in Python by (48.4k points)

Can anyone tell me how to print data type in python?

1 Answer

0 votes
by (104k points)

You can use type () function to print the data type of a variable.

Example:

score = 95

type(score)

output:

int

You can use .dtypes to print the data types of all the columns of a dataframe.

Example:

#to find datatypes of all columns

df.dtypes

If you wish to learn Python from an online course, then enroll in this Python Course by Intellipaat provides instructor-led training, lifetime access, certification, and job assistance.

Related questions

0 votes
1 answer
0 votes
1 answer
asked May 30, 2020 in Python by Sudhir_1997 (51.2k points)
0 votes
1 answer
asked Sep 3, 2020 in Python by ashely (48.4k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...