Python Tutorials - Herong's Tutorial Examples - v2.15, by Herong Yang
pandas.core.series.Series - The Column Class
This section describes pandas.core.series.Series class, which represents a column of data.
What Is pandas.core.frame.Series? pandas.core.frame.Series is a class that represents a column of data.
Main features of pandas.DataFrame are:
Here are some basic properties, operations and methods provided in pandas.core.frame.Series class.
1. df[col_name] - Method to extract a given column from a DataFrame as a Series.
>>> import pandas as pd
>>>
df = pd.DataFrame({
"Name": [
"Braund, Mr. Owen Harris",
"Allen, Mr. William Henry",
"Bonnell, Miss. Elizabeth",
],
"Age": [22, 35, 58],
"Sex": ["male", "male", "female"],
})
>>> ser = df["Name"]
>>> type(ser)
pandas.core.series.Series
>>> print(ser)
ser
0 Braund, Mr. Owen Harris
1 Allen, Mr. William Henry
2 Bonnell, Miss. Elizabeth
Name: Name, dtype: object
2. ser.unique() - Method to return unique values as a Series.
Table of Contents
Variables, Operations and Expressions
Function Statement and Function Call
List, Set and Dictionary Comprehensions
Packages and Package Directories
"pathlib" - Object-Oriented Filesystem Paths
"pip" - Package Installer for Python
SciPy.org - Python Libraries for Science
►pandas - Data Analysis and Manipulation
pandas.DataFrame/pandas.core.frame.DataFrame - The Table Class
►pandas.core.series.Series - The Column Class
File Input and Output for DataFrame
Anaconda - Python Environment Manager