I'm supposed to create a palindrome checker and convert them into dataFrame.
The code:
import pandas as pd
# TODO: Check if the number is palindrome or not and convert them into DataFrame
n = [1,0,1]
g = n == n[::-1]
a = pd.DataFrame(n)
a['Is Palindrome'] = g
a.transpose()
The Output:
0 1 2
0 3 0 3
Is Palindrome True True True
But the output I want the DataFrame to print is:
0 1 2 Is Palindrome
3 0 3 True
How do I build that?