How to get the class of all columns in a pandas DataFrame in the Python programming language. More details:
https://statisticsglobe.com/check-data-type-columns-pandas-dataframe-python
Python code of this video:
import pandas as pd # Import pandas library
data = pd.DataFrame({'x1':range(60, 55, - 1), # Create pandas DataFrame
'x2':['a', 'b', 'c', 'b', 'c'],
'x3':[True, False, False, True, True]})
print(data) # Print pandas DataFrame
print(data.x1.dtype) # Print type of one column
# int64
print(data.dtypes) # Print type of all columns
# x1 int64
# x2 object
# x3 bool
# dtype: object
Follow me on Social Media:
Facebook – Statistics Globe Page:
https://www.facebook.com/statisticsglobecom/
Facebook – R Programming Group for Discussions & Questions:
https://www.facebook.com/groups/statisticsglobe
Facebook – Python Programming Group for Discussions & Questions:
https://www.facebook.com/groups/statisticsglobepython
LinkedIn – Statistics Globe Page:
https://www.linkedin.com/company/statisticsglobe/
LinkedIn – R Programming Group for Discussions & Questions:
https://www.linkedin.com/groups/12555223/
LinkedIn – Python Programming Group for Discussions & Questions:
https://www.linkedin.com/groups/12673534/
Twitter:
https://twitter.com/JoachimSchork
Music by bensound.com
Тэги:
#statistics_globe #statisticsglobe.com #statistical_programming #python_programming #python_programming_language #python_statistics #jupyter_notebook #python_language #python_tutorial #learn_python #python_code #python_programming_tutorial #data_science #data_scientist #learn_data_science #Check_Data_Type_of_Columns_in_pandas_DataFrame #Get_dtype_in_Python #How_to_get_the_class_of_all_columns #Get_Data_Type_of_Single_Column #Get_Data_Type_of_All_Columns #pandas_DataFrame