Python Forum
add the suffix to the next line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
add the suffix to the next line
#1
Hi,

Does anybody know the shortest command to add a suffix to the header of several columns below the header and not on the same line?

I have the dataframe below:

   Type     Price1     Price2     Price3      Price4      Price5      
0    A       5.467     17.450     14.340     233.440     143.550
1    B      12.347     33.776     19.700     443.335     119.450
and if I use add_suffix(' USD'), it adds the USD on the same line:

   Type     Price1 USD     Price2 USD     Price3 USD      Price4 USD      Price5 USD      
0    A           5.467         17.450         14.340         233.440         143.550
1    B          12.347         33.776         19.700         443.335         119.450
While I want the USD in the line below of the prices:

   Type     Price1     Price2     Price3      Price4      Price5      
               USD        USD        USD         USD         USD
0    A       5.467     17.450     14.340     233.440     143.550
1    B      12.347     33.776     19.700     443.335     119.450
Reply


Messages In This Thread
add the suffix to the next line - by Paulman - Dec-04-2021, 05:55 PM
RE: add the suffix to the next line - by BashBedlam - Dec-04-2021, 06:13 PM
RE: add the suffix to the next line - by Paulman - Dec-05-2021, 10:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  String add prefix & suffix nahom 3 3,261 Sep-30-2019, 11:09 PM
Last Post: Gribouillis
  number plus suffix Skaperen 5 3,533 Jun-05-2019, 07:10 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020