Maybe another way of looking at this is converting a column of tuples to a DataFrame, like so:
In [10]: DataFrame(df['Turnstile'].tolist())
Out[10]:
0 1 2 3
0 A006 R079 00-00-04 5 AVE-59 ST
1 A006 R079 00-00-04 5 AVE-59 ST
2 A006 R079 00-00-04 5 AVE-59 ST
3 A006 R079 00-00-04 5 AVE-59 ST
4 A006 R079 00-00-04 5 AVE-59 ST
5 A006 R079 00-00-04 5 AVE-59 ST
6 A006 R079 00-00-04 5 AVE-59 ST
7 A006 R079 00-00-04 5 AVE-59 ST
8 A006 R079 00-00-04 5 AVE-59 ST
9 A006 R079 00-00-04 5 AVE-59 ST
If that's the case, here's an example that converts the column of tuples to a DataFrame and adds it back to the original dataframe:
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
# create a fake dataframe, repeating the tuple given in the example
In [2]: df = DataFrame(data={'Observations': np.random.randn(10) * np.arange(10),
...: 'Turnstile': (('A006', 'R079', '00-00-04', '5 AVE-59 ST'),)*10})
In [3]: df.head()
Out[3]:
Observations Turnstile
0 -0.000000 (A006, R079, 00-00-04, 5 AVE-59 ST)
1 -0.022668 (A006, R079, 00-00-04, 5 AVE-59 ST)
2 -2.380515 (A006, R079, 00-00-04, 5 AVE-59 ST)
3 -4.209983 (A006, R079, 00-00-04, 5 AVE-59 ST)
4 3.932902 (A006, R079, 00-00-04, 5 AVE-59 ST)
# all at once turn the column of tuples into a dataframe and concat that with the original df
In [4]: df = pd.concat([df,DataFrame(df['Turnstile'].tolist())], axis=1, join='outer')
In [5]: df.head()
Out[5]:
Observations Turnstile 0 1 2 \
0 -0.000000 (A006, R079, 00-00-04, 5 AVE-59 ST) A006 R079 00-00-04
1 -0.022668 (A006, R079, 00-00-04, 5 AVE-59 ST) A006 R079 00-00-04
2 -2.380515 (A006, R079, 00-00-04, 5 AVE-59 ST) A006 R079 00-00-04
3 -4.209983 (A006, R079, 00-00-04, 5 AVE-59 ST) A006 R079 00-00-04
4 3.932902 (A006, R079, 00-00-04, 5 AVE-59 ST) A006 R079 00-00-04
3
0 5 AVE-59 ST
1 5 AVE-59 ST
2 5 AVE-59 ST
3 5 AVE-59 ST
4 5 AVE-59 ST
# i assume you don't need this column anymore
In [6]: del df['Turnstile']
If that works you can of course name the new columns as needed.
type(df.Turnstile.values[0])?[type(df.Turnstile.values[0][i]) for i in range(4)df.head()?