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

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.

主站蜘蛛池模板: 张掖市| 宝鸡市| 清水县| 西宁市| 鄱阳县| 碌曲县| 依兰县| 阜南县| 镇远县| 华池县| 罗城| 涟水县| 兴山县| 仁化县| 乌什县| 尉犁县| 余姚市| 洪雅县| 格尔木市| 阿城市| 阿城市| 青田县| 新建县| 肥西县| 临江市| 白城市| 伊宁市| 开江县| 荥阳市| 清水河县| 宁南县| 兴业县| 遂川县| 手游| 韶关市| 繁昌县| 榆中县| 庆云县| 睢宁县| 洱源县| 汉寿县|