For the Pandas dataframe
df
Language # of Files Blank Lines Comment Lines Code Lines
C++ 15 66 35 354
C/C++ Header 1 3 7 4
Markdown 6 73 0 142
Python 110 1998 2086 4982
Tcl/Tk 1 14 18 273
YAML 1 0 6 20
when I use the code below, it sums each column with NAN
for non-integer
df = df.append(df.sum(numeric_only=True), ignore_index=True)
output
Language # of Files Blank Lines Comment Lines Code Lines
C++ 15 66 35 354
C/C++ Header 1 3 7 4
Markdown 6 73 0 142
Python 110 1998 2086 4982
Tcl/Tk 1 14 18 273
YAML 1 0 6 20
NAN 134 2154 2152 5775
What should I change in the code to add a string "Total" instead of NAN
Language # of Files Blank Lines Comment Lines Code Lines
C++ 15 66 35 354
C/C++ Header 1 3 7 4
Markdown 6 73 0 142
Python 110 1998 2086 4982
Tcl/Tk 1 14 18 273
YAML 1 0 6 20
TOTAL 134 2154 2152 5775