Pandas DataFrame 查看数据的统计信息和摘要信息
【摘要】 环境信息ModelArtsNotebook - Multi-Engine 2.0 (python3)JupyterLab - Notebook - Conda-python3pandas 0.22.0 Pandas DataFrame 查看数据的统计信息和摘要信息import pandas as pdimport numpy as npdata = pd.DataFrame(np.ran...
环境信息
- ModelArts
- Notebook - Multi-Engine 2.0 (python3)
- JupyterLab - Notebook - Conda-python3
- pandas 0.22.0
- JupyterLab - Notebook - Conda-python3
- Notebook - Multi-Engine 2.0 (python3)
Pandas DataFrame 查看数据的统计信息和摘要信息
import pandas as pd
import numpy as np
data = pd.DataFrame(np.random.randint(100,size=(5,8)))
data
# 查看摘要
data.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5 entries, 0 to 4
Data columns (total 8 columns):
0 5 non-null int64
1 5 non-null int64
2 5 non-null int64
3 5 non-null int64
4 5 non-null int64
5 5 non-null int64
6 5 non-null int64
7 5 non-null int64
dtypes: int64(8)
memory usage: 400.0 bytes
# 查看统计信息
data.describe()
help
help(data.info)
Help on method info in module pandas.core.frame:
info(verbose=None, buf=None, max_cols=None, memory_usage=None, null_counts=None) method of pandas.core.frame.DataFrame instance
Concise summary of a DataFrame.
help(data.describe)
Help on method describe in module pandas.core.generic:
describe(percentiles=None, include=None, exclude=None) method of pandas.core.frame.DataFrame instance
Generates descriptive statistics that summarize the central tendency,
dispersion and shape of a dataset's distribution, excluding
``NaN`` values.
Analyzes both numeric and object series, as well
as ``DataFrame`` column sets of mixed data types. The output
will vary depending on what is provided. Refer to the notes
below for more detail.
备注
- 欢迎各位同学一起来交流学习心得^_^
- 在线课程、沙箱实验、认证、论坛和直播,其中包含了许多优质的内容,推荐了解与学习。
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)