Pandas Dataframe String Formatting (access A Given Column)
I try to use new-style formatting to display the entry at a given/specified column: np.random.seed(1234) df = pd.DataFrame(np.random.randint(7, size=(2, 2)), columns=['a', 'b']) c
Solution 1:
I think you can remove ''
in one['a']
:
print("Here is {one[a]} and {two}".format(one=c, two=c['b']))
Here is3and6
Post a Comment for "Pandas Dataframe String Formatting (access A Given Column)"