Column Names and Data Types
To see all the column names as a list, we have to use this line of code:
python
We can also get a summary of all the types of data that are in the dataframe. For this, we have to use the following attribute: .dtypes
.
python
Task
Swipe to start coding
You are given a DataFrame
named wine_data
.
- Get the column names that this
DataFrame
contains and store the result in thecolumn_names
variable. - Get the data types of these columns from this
DataFrame
and store the result in thedata_types
variable.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 5