chinayangyongyong
chinayangyongyong

Reputation: 37

Python vaex how to create dataframe from a CSV file?

Why do I only get the last column

if __name__ == '__main__':
# win远程linux运行
import vaex,pandas as pd
df_pd = pd.read_csv('./a.csv')  # contains 4 columns
print(df_pd)
print(list(df_pd.columns))
df = vaex.from_pandas(df_pd)   # only last column   # why???
print(df)

Why do I only get the last column

Upvotes: 1

Views: 3646

Answers (2)

Harish Somasundar
Harish Somasundar

Reputation: 21

To create a vaex dataframe out of a csv file.

Try, vaex.from_csv('a.csv')

If the dataset is huge and is around billions of data then you might have to use chunk_size in from_csv to avoid memory issues.

Upvotes: 1

Maarten Breddels
Maarten Breddels

Reputation: 1484

Vaex replaces non-ascii characters by an underscore, but two underscores means 'hidden' column. We should change that, and I've opened an issue for that: https://github.com/vaexio/vaex/issues/558

Upvotes: 1

Related Questions