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

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.

主站蜘蛛池模板: 固阳县| 英超| 集贤县| 金塔县| 泰来县| 嘉兴市| 六枝特区| 皮山县| 凤台县| 沁水县| 景德镇市| 钟山县| 高台县| 库车县| 平乡县| 靖州| 天全县| 抚宁县| 霞浦县| 新丰县| 金堂县| 内乡县| 邵阳市| 临夏县| 尼玛县| 乐亭县| 内丘县| 衡南县| 应用必备| 普兰县| 五河县| 寿光市| 富平县| 枞阳县| 苍梧县| 西宁市| 河南省| 新晃| 麟游县| 雷波县| 买车|