官术网_书友最值得收藏!

  • Matplotlib 2.x By Example
  • Allen Yu Claire Chung Aldrin Yim
  • 154字
  • 2021-07-02 19:34:33

The pandas way

Similar to Numpy, pandas offers an easy way to load text files into a pandas dataframe:

import pandas as pd
pd.read_csv(usecols=1)

Here the separation can be denoted by either sep or delimiter, which is set as comma , by default (CSV stands for comma-separated values).

There is a long list of less commonly used options available as to determine how different data formats, data types, and errors should be handled. You may refer to the documentation at http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html. Besides flat CSV files, Pandas also has other built-in functions for reading other common data formats, such as Excel, JSON, HTML, HDF5, SQL, and Google BigQuery.

To stay focused on data visualization, we will not dig deep into the methods of data cleaning in this book, but this is a survival skill set very helpful in data science. If interested, you can check out resources on data handling with Python.

主站蜘蛛池模板: 双鸭山市| 徐闻县| 陇西县| 贵溪市| 尖扎县| 兴文县| 朝阳市| 广灵县| 沁源县| 鄂尔多斯市| 卫辉市| 东乌珠穆沁旗| 富裕县| 平顺县| 分宜县| 林口县| 青浦区| 甘南县| 伊通| 迁西县| 巧家县| 泸州市| 宜春市| 滁州市| 黄浦区| 呼和浩特市| 宜州市| 宁波市| 东阿县| 海兴县| 云南省| 西丰县| 岳阳县| 大埔区| 桦南县| 宝山区| 平度市| 富平县| 雷山县| 佛学| 务川|