使用python进行数据提取和数据处理

Whenever a dataset comes the first step is to extract data and manipulate it. It is the most important part as it gives the most useful information about the dataset. I have taken the IPL dataset. Let's see how it's done.

每当数据集出现时,第一步就是提取数据并对其进行处理。 这是最重要的部分,因为它提供了有关数据集的最有用的信息。 我已经获取了IPL数据集。 让我们看看它是如何完成的。

At first, we need to import libraries such as pandas and NumPy.

首先,我们需要导入诸如pandas和NumPy之类的库。

Image for post

After that, we need to read the dataset. I am using a “df” variable to store the dataset.

之后,我们需要读取数据集。 我正在使用“ df”变量来存储数据集。

Image for post

After reading the dataset. If we want the first 5 rows of the dataset then we can use the head function. It is not compulsory that we will only get the top 5 rows. we can pass any value between the head function. If we do df.head(10) then we will get the top 10 rows of the dataset.

读取数据集后。 如果我们想要数据集的前5行,则可以使用head函数。 我们只获得前5行不是强制性的。 我们可以在head函数之间传递任何值。 如果执行df.head(10),则将获得数据集的前10行。

  • 1
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值