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

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.

主站蜘蛛池模板: 武功县| 民权县| 阳春市| 富源县| 本溪| 丘北县| 德兴市| 资源县| 桃园县| 凭祥市| 观塘区| 同仁县| 乌拉特前旗| 孙吴县| 潍坊市| 荥经县| 浪卡子县| 邵武市| 班戈县| 交城县| 荔浦县| 普兰县| 内乡县| 奎屯市| 公主岭市| 都匀市| 永和县| 洪江市| 新河县| 江源县| 鄂州市| 贺州市| 松潘县| 高邑县| 馆陶县| 河东区| 黔东| 昌平区| 北辰区| 镇安县| 彭山县|