'How to add new columns to vaex dataframe? Type Error

How to add new columns to vaex dataframe?

I received the type error when I try to assign a list object to the dataframe, as is done in pandas, but received following error:

ValueError: [1, 1, 1, 1, 1, 1, 1] is not of string or Expression type, but <class 'list'>


Solution 1:[1]

Simple; convert list object to numpy array, and i guess that's what they define as expression type;

import numpy as np
a = [1]*7
a = np.array(a)
sub["new"] = a
sub

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Guangxuan Xu