Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)

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

1 Answer

0 votes
by (108k 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 (55.6k points)
0 votes
1 answer
asked Sep 3, 2020 in Python by ashely (50.2k points)
0 votes
1 answer

Browse Categories

...