Seksjon 1. Kapittel 15
single
Column Names and Data Types
Sveip for å vise menyen
To display all column names as a list, use the following line of code:
column_names = df.columns
To get a summary of all data types in the DataFrame, use the following attribute:
.dtypes.
data_types = df.dtypes
Oppgave
Swipe to start coding
You are given a DataFrame named wine_data.
- Get the column names that this
DataFramecontains and store the result in thecolumn_namesvariable. - Get the data types of these columns from this
DataFrameand store the result in thedata_typesvariable.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 15
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår