column name cannot be "values"? #1198
Unanswered
tearsofwein
asked this question in
Q&A
Replies: 1 comment
-
@tearsofwein I'm using the following versions and could not re-create your issue. However, I did experience the "AttributeError: can't set attribute." recently when opening from pandas, parquet or arrow table. Our SQL database, from which my own records were sourced from, had a column named 'data' and that tripped vaex up because it itself has a field named 'data'. I renamed 'data' to 'raw_data' in my files and the problem disappeared. {'vaex': '4.3.0', |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hallo,
I tried two scripts.
This first one works fine.
data = {"column1":[1,2,3],"column2":[2,3,4],"vv":[3,4,5]}
pdf_value_test = pd.DataFrame( data = data )
pdf_value_test.to_parquet( "pdf_value_test.parquet" )
vdf_value_test = vaex.open( "pdf_value_test.parquet" )
But the second one fails with error.
data = {"column1":[1,2,3],"column2":[2,3,4],"values":[3,4,5]}
pdf_value_test = pd.DataFrame( data = data )
pdf_value_test.to_parquet( "pdf_value_test.parquet" )
in
----> 1 vdf_value_test = vaex.open( "pdf_value_test.parquet" )
2 vdf_value_test
~/anaconda3/envs/vaex/lib/python3.9/site-packages/vaex/init.py in open(path, convert, shuffle, fs_options, fs, *args, **kwargs)
215 else:
216 ds = vaex.dataset.open(path, fs_options=fs_options, fs=fs, **kwargs)
--> 217 df = vaex.from_dataset(ds)
218 if df is None:
219 if os.path.exists(path):
~/anaconda3/envs/vaex/lib/python3.9/site-packages/vaex/init.py in from_dataset(dataset)
370 def from_dataset(dataset: vaex.dataset.Dataset) -> vaex.dataframe.DataFrame:
371 '''Create a Vaex DataFrame from a Vaex Dataset'''
--> 372 return vaex.dataframe.DataFrameLocal(dataset)
373
374
~/anaconda3/envs/vaex/lib/python3.9/site-packages/vaex/dataframe.py in init(self, dataset)
4884 self.column_names = list(self.dataset)
4885 for column_name in self.column_names:
-> 4886 self._initialize_column(column_name)
4887 if len(self.dataset):
4888 self._length = self.dataset.row_count
~/anaconda3/envs/vaex/lib/python3.9/site-packages/vaex/dataframe.py in _initialize_column(self, name)
2973
2974 def _initialize_column(self, name):
-> 2975 self._save_assign_expression(name)
2976
2977 def _sparse_matrix(self, column):
~/anaconda3/envs/vaex/lib/python3.9/site-packages/vaex/dataframe.py in _save_assign_expression(self, name, expression)
3002 expression = vaex.utils.valid_expression(self.get_column_names(hidden=True), expression)
3003 expression = Expression(self, expression)
-> 3004 setattr(self, name, expression)
3005
3006 @_hidden
AttributeError: can't set attribute.
So my questions is that, it seems vaex does not support a column name with "values"?
Thanks to guys who can answer this question.
Beta Was this translation helpful? Give feedback.
All reactions