python split by space code example
Example 1: python split first space
>>> s = "238 NEO Sports"
>>> s.split(" ", 1)
['238', 'NEO Sports']
Example 2: pandas split by space
# importing pandas module
import pandas as pd
# new data frame with split value columns
data["Team"]= data["Team"].str.split(" ", n = 1, expand = True)
# df display
data
Example 3: split string by spaces python
"many fancy word \nhello \thi".split()
['many', 'fancy', 'word', 'hello', 'hi']