一.导入pandas库并起别名为pd:
import pandas as pd
二.pandas的DataFrame函数原型:
DataFrame([data, index, columns, dtype, copy]);
三.函数详解
DataFrame([data, index, columns, dtype, copy])
参数:
data : ndarray (structured or homogeneous), Iterable, dict, or DataFrame
Dict can contain Series, arrays, constants, or list-like objects
index : Index or array-like
Index to use for resulting frame. Will default to RangeIndex if no indexing information part of input data and no index provided
columns : Index or array-like
Column labels to use for resulting frame. Will default to RangeIndex (0, 1, 2, …, n) if no column labels are provided
dtype : dtype, default None
Data type to force. Only a single dtype is