Course Content
Pandas First Steps
Pandas First Steps
Series
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.
import pandas as pd numbers = [17, 43, 74, 20] series = pd.Series(numbers) print(series)
In this example, we use the pd.Series()
constructor to create a Series
object containing a list of numbers.
Swipe to show code editor
Your task is to create two Series
objects from two existing lists, even_numbers
and states
.
Solution
Thanks for your feedback!
Series
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.
import pandas as pd numbers = [17, 43, 74, 20] series = pd.Series(numbers) print(series)
In this example, we use the pd.Series()
constructor to create a Series
object containing a list of numbers.
Swipe to show code editor
Your task is to create two Series
objects from two existing lists, even_numbers
and states
.
Solution
Thanks for your feedback!