Python Forum
How to change a dataframe column to lower case
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change a dataframe column to lower case
#4
(Oct-29-2019, 04:11 PM)zhujp98 Wrote: I want to change one of columns to lower case.

Hi again!

Then maybe you could use something like:

df['AGE'].str.lower()
and if it is for all the columns, you could use something like:

data.columns = [x.lower() for x in data.columns]
I have based my answer on these:

https://stackoverflow.com/questions/2224...ing-values

https://stackoverflow.com/questions/1972...-lowercase

All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Messages In This Thread
RE: How to change a dataframe column to lower case - by newbieAuggie2019 - Oct-29-2019, 04:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding PD DataFrame column bsben 2 432 Mar-08-2024, 10:46 PM
Last Post: deanhystad
  Python Alteryx QS-Passing pandas dataframe column inside SQL query where condition sanky1990 0 841 Dec-04-2023, 09:48 PM
Last Post: sanky1990
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 1,040 Feb-15-2023, 05:34 PM
Last Post: zsousa
  How to apply function lower() to the list? Toltimtixma 2 856 Feb-10-2023, 05:15 PM
Last Post: Toltimtixma
  Difference one column in a dataframe Scott 0 718 Feb-10-2023, 08:41 AM
Last Post: Scott
  splitting a Dataframe Column in two parts nafshar 2 1,062 Jan-30-2023, 01:19 PM
Last Post: nafshar
  Change a numpy array to a dataframe Led_Zeppelin 3 1,232 Jan-26-2023, 09:01 PM
Last Post: deanhystad
  Beginner Higher Lower Game wallytan 2 1,715 Sep-29-2022, 05:14 PM
Last Post: deanhystad
  How to assign a value to pandas dataframe column rows based on a condition klllmmm 0 943 Sep-08-2022, 06:32 AM
Last Post: klllmmm
  renaming the 0 column in a dataframe Led_Zeppelin 5 1,810 Aug-16-2022, 04:07 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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