How add label in column as string for numpy array
I need this output
One Two Three A 1, 2, 3 B 4, 5, 6
import numpy as np
import pandas as pd
a=pd.DataFrame.from_items([('A', [1, 2, 3]), ('B', [4, 5, 6])],
orient='index', columns=['one', 'two', 'three'])
print(a)
when I use this code, the code give me the correct result, but also give me a error; that I don't understand.
Note:I dont understand this line
a=pd.DataFrame.from_items([('A', [1, 2, 3]), ('B', [4, 5, 6])],
orient='index', columns=['one', 'two', 'three'])
I need another method to implement this.
Output:
one two three A 1 2 3 B 4 5 6 C:\Users\Toufik\Anaconda3\lib\site-packages\ipykernel_launcher.py:4: FutureWarning: from_items is deprecated. Please use DataFrame.from_dict(dict(items), ...) instead. DataFrame.from_dict(OrderedDict(items)) may be used to preserve the key order. after removing the cwd from sys.path.