Python Forum
Split Column Text by Number of Characters
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Split Column Text by Number of Characters
#1
Hello all,

Brand new to Python! I've tried search keywords for this solution but came up with unrelated examples with commas / delimiters. Any assistance would be greatly appreciated.

Loading from csv into a df,

Data set column = "Month of Year" - values (201801,201802,201803)
I would like to split up this column into a Month and a Year column ( Month = 01, Year = 2018 ).

In excel, this would be a text to column function, any idea on what the equivalent would be in python?

Thank you
Reply


Messages In This Thread
Split Column Text by Number of Characters - by cgoldstein - Mar-11-2019, 02:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Brick Number stored as text with openpyxl CAD79 2 437 Apr-17-2024, 10:17 AM
Last Post: CAD79
  doing string split with 2 or more split characters Skaperen 22 2,520 Aug-13-2023, 01:57 AM
Last Post: Skaperen
Sad How to split a String from Text Input into 40 char chunks? lastyle 7 1,132 Aug-01-2023, 09:36 AM
Last Post: Pedroski55
  How to remove patterns of characters from text aaander 4 1,116 Nov-19-2022, 03:34 PM
Last Post: snippsat
  Two text files, want to add a column value zxcv101 8 1,921 Jun-20-2022, 03:06 PM
Last Post: deanhystad
  Split a number to list and list sum must be number sunny9495 5 2,288 Apr-28-2022, 09:32 AM
Last Post: Dexty
  How to split file by same values from column from imported CSV file? Paqqno 5 2,788 Mar-24-2022, 05:25 PM
Last Post: Paqqno
  Find if chain of characters or number Frankduc 4 1,800 Feb-11-2022, 01:55 PM
Last Post: Frankduc
  Search text in PDF and output its page number. atomxkai 21 8,932 Jan-21-2022, 06:20 AM
Last Post: snippsat
  Split single column to multiple columns SriRajesh 1 1,329 Jan-07-2022, 06:43 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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