本文整理汇总了Python中blaze.data.CSV.pandas_read_csv方法的典型用法代码示例。如果您正苦于以下问题:Python CSV.pandas_read_csv方法的具体用法?Python CSV.pandas_read_csv怎么用?Python CSV.pandas_read_csv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类blaze.data.CSV
的用法示例。
在下文中一共展示了CSV.pandas_read_csv方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_into_DataFrame_concat
# 需要导入模块: from blaze.data import CSV [as 别名]
# 或者: from blaze.data.CSV import pandas_read_csv [as 别名]
def test_into_DataFrame_concat():
csv = CSV(os.path.join(os.path.dirname(__file__),
'accounts.csv'))
df = into(pd.DataFrame, Concat([csv, csv]))
csv_df = csv.pandas_read_csv()
assert df.index.tolist() == list(range(len(df)))
assert df.values.tolist() == (csv_df.values.tolist() +
csv_df.values.tolist())
assert df.columns.tolist() == csv_df.columns.tolist()
示例2: test_datetime_csv_reader_same_as_into_types
# 需要导入模块: from blaze.data import CSV [as 别名]
# 或者: from blaze.data.CSV import pandas_read_csv [as 别名]
def test_datetime_csv_reader_same_as_into_types():
csv = CSV(os.path.join(os.path.dirname(__file__),
'accounts.csv'))
rhs = csv.pandas_read_csv().dtypes
df = into(pd.DataFrame, csv)
dtypes = df.dtypes
expected = pd.Series([np.dtype(x) for x in
['i8', 'i8', 'O', 'datetime64[ns]']],
index=csv.columns)
assert dtypes.index.tolist() == expected.index.tolist()
assert dtypes.tolist() == expected.tolist()
示例3: test_datetime_csv_reader_same_as_into
# 需要导入模块: from blaze.data import CSV [as 别名]
# 或者: from blaze.data.CSV import pandas_read_csv [as 别名]
def test_datetime_csv_reader_same_as_into():
csv = CSV(os.path.join(os.path.dirname(__file__),
'accounts.csv'))
rhs = csv.pandas_read_csv().dtypes
df = into(pd.DataFrame, csv)
dtypes = df.dtypes
expected = pd.Series([np.dtype(x) for x in
['i8', 'i8', 'O', 'datetime64[ns]']],
index=csv.columns)
# make sure reader with no args does the same thing as into()
# Values the same
assert dtypes.index.tolist() == rhs.index.tolist()
assert dtypes.tolist() == rhs.tolist()