Sectie 1. Hoofdstuk 2
single
Series
Veeg om het menu te tonen
Pandas offers two primary data structures: Series and DataFrame. The Series is the simpler of the two, resembling a one-dimensional array or a list. You can create a Series object using the pd.Series() constructor by passing a list as its argument.
12345import pandas as pd numbers = [17, 43, 74, 20] series = pd.Series(numbers) print(series)
You use the pd.Series() constructor to create a Series object that contains a list of numbers.
Taak
Swipe to start coding
You are given two lists: even_numbers and states.
- Create a
Seriesnamednumbers_seriesfrom theeven_numberslist. - Create a
Seriesnamedstates_seriesfrom thestateslist.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 2
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.