0 votes
1 view
in Python by (15.9k points)

I have a pandas Dataframe like as follow:

                   column1         column2

0                     0               0

1                     0               0

2                     0               0

3                     0               0

...                  ...             ...

I would like to change all data in column2 with

a = numpy.zeros([16,16,16])

so the dataframe will look like

                   column1         column2

0                     0           [[[0,0,0,....

1                     0           [[[0,0,0,....

2                     0           [[[0,0,0,....

3                     0           [[[0,0,0,....

...                  ...             ...

1 Answer

0 votes
by (25.1k points)

To change the data in a data frame and set to your desired value you can do this:

df['column2'] = [x for idx in df.index]

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...