'Saving data in the table

How I can save this:

a=1
b=2
c=3
d=4

into the table like this (I do not need header):

1 2 3 4

Thanks.



Solution 1:[1]

If create DataFrame there is default header:

df = pd.DataFrame([[a,b,c,d]])
print (df)
   0  1  2  3
0  1  2  3  4

Solution 2:[2]

You could just use this:

table = [a, b, c, d]
print(table)

prints:

[1, 2, 3, 4]

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 jezrael
Solution 2 YourHelper