数据示例:
# -*- coding:utf-8 -*-
import pandas as pd
df = pd.read_csv(r'e:\zsxq\v6\1\topics.csv', header=None)
df.head(10)

需求:
现在需要筛选出指定时间范围内的所有行,那就需要知道索引为 1 的列的值是什么数据类型。
具体方法:
type(df)
pandas.core.frame.DataFrame
type(df[1])
pandas.core.series.Series
df.info()

df.dtypes

type(df[1][0])

from pandas.api.types import is_string_dtype
from pandas.api.types import is_numeric_dtype
from pandas.api.types import is_timedelta64_dtype
is_string_dtype(df[1])

网友评论