data = pd.read_csv('dataaa.csv', usecols=[1], header=None)
usecols : array-like or callable, default None
Return a subset of the columns. If array-like, all elements must
either be positional (i.e. integer indices into the document columns)
or strings that correspond to column names provided either by the user
in names or inferred from the document header row(s). For example, a
valid array-like usecols parameter would be [0, 1, 2] or [‘foo’,
‘bar’, ‘baz’].
If callable, the callable function will be evaluated against the column names, returning names where the callable function evaluates to
True. An example of a valid callable argument would be lambda x:
x.upper() in ['AAA', 'BBB', 'DDD']. Using this parameter results in
much faster parsing time and lower memory usage.
您可以使用read_cv函数中的
usecols
关键字。查看完整的documentation。在相关问题 更多 >
编程相关推荐