Home > other >  Pandas add one line
Pandas add one line

Time:11-13

Df3_g. Loc [' total ']=list (np) arange (25))

I tried assignment scalar, lists, arrays are no error this

Always append a non - a category item to a CategoricalIndex

CodePudding user response:

 import pandas as pd 
Df=pd DataFrame (columns=(' lib ', 'qty1', 'qty2))
Df=df append ([{' qty1 ', 10.0 'qty2:98}], ignore_index=True)
Print (df)

CodePudding user response:

reference 1/f, happy pigs response:
 import pandas as pd 
Df=pd DataFrame (columns=(' lib ', 'qty1', 'qty2))
Df=df append ([{' qty1 ', 10.0 'qty2:98}], ignore_index=True)
Print (df)


Because in the actual application, I am two lines together, so can't use a dictionary to append
  • Related