python CSV模块vs pandas [英] python CSV module vs Pandas

查看:132
本文介绍了python CSV模块vs pandas 的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用熊猫读取CSV文件数据,但是那里也有CSV模块来管理CSV文件.

所以我的问题是:-

两者之间有什么区别?

在CSV模块上使用熊猫有什么弊端?

解决方案

基于基准测试

  • CSV更快地加载了较小的数据集(<1K行)的数据

  • 大数据集的熊猫速度要快几倍

生成基准的代码

基准

I am using pandas to read CSV file data, but the CSV module is also there to manage the CSV file.

so my questions are :-

what is the difference between these both?

what are the cons of using pandas over the CSV module?

解决方案

Based upon benchmarks

  • CSV is faster to load data for smaller datasets (< 1K rows)

  • Pandas is several times faster for larger datasets

Code to Generate Benchmarks

Benchmarks

这篇关于python CSV模块vs pandas 的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆