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

CSV format

Comma-separated value (CSV) files are the most popular formats for storing tabular data generated by IoT systems. In a .csv file, the values of the records are stored in plain-text rows, with each row containing the values of the fields separated by a separator. The separator is a comma by default but can be configured to be any other character. In this section, we will learn how to use data from CSV files with Python's csv, numpy, and pandas modules. We will use the household_power_consumption data file. The file can be downloaded from the following GitHub link: https://github.com/ahanse/machlearning/blob/master/household_power_consumption.csv. To access the data files, we define the following variables:

data_folder = '../../data/household_power_consumption' 
data_file = 'household_power_consumption.csv'

Generally, to quickly read the data from CSV files, use the Python csv module; however, if the data needs to be interpreted as a mix of date, and numeric data fields, it's better to use the pandas package. If the data is only numeric, NumPy is the most appropriate package.

主站蜘蛛池模板: 隆昌县| 宁陕县| 马边| 布尔津县| 通渭县| 沭阳县| 民丰县| 普宁市| 莆田市| 柏乡县| 廉江市| 探索| 扎兰屯市| 忻城县| 当涂县| 荥阳市| 鹤庆县| 黑山县| 葵青区| 会昌县| 崇仁县| 休宁县| 德化县| 邓州市| 桂阳县| 台湾省| 苏尼特右旗| 资中县| 大悟县| 通山县| 吉水县| 滕州市| 锡林浩特市| 阜平县| 汽车| 中方县| 嘉兴市| 梅河口市| 花莲县| 青岛市| 宝鸡市|