Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

dictionary to a dataframe pandas arrays must all be same length

pd.DataFrame.from_dict(df, orient='index').transpose() #A

pd.DataFrame(dict([ (k,pd.Series(v)) for k,v in df.items() ])) #B (Better)
 
PREVIOUS NEXT
Tagged: #dictionary #dataframe #pandas #arrays #length
ADD COMMENT
Topic
Name
1+8 =