split column in exact spot python

Solutions on MaxInterview for split column in exact spot python by the best coders in the world

showing results for - "split column in exact spot python"
Fabian
13 Nov 2018
1df['Basic Stats'].str[9:13]
2
3
4
50    2010
61    2009
72    2008
83    2007
94    2006
10Name: Basic Stats, dtype: object
Dante
17 Sep 2020
1df["Basic Stats"] = df["Basic Stats"].str.slice(9,13)
2
3
4
5  Basic Stats       Min       Max      Mean     Stdev
60        2010  0.336438  0.743478  0.592622  0.052544
71        2009  0.313259  0.678561  0.525667  0.048047
82        2008  0.374522  0.746828  0.583513  0.055989
93        2007 -0.000000  0.749325  0.330068  0.314351
104        2006 -0.000000  0.819288  0.600136  0.170060