Series to list

EasyPandas Programs · 2 of 95

Write a pandas program to convert a Series to a list and print its type.

Advertisement
Output
[15, 43, 88] list

Approach

  1. tolist().

Solution

Python
import pandas as pditems = pd.Series([15, 43, 88]).tolist()print(items, type(items).__name__)
Output
[15, 43, 88] list
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More pandas programs

← All 95 Pandas Programs