How do I create a new data frame named after each entry in an array?
I have an array created from a Pandas data frame column. It looks something like below.
[In] company_id = df.COMPANY_IDENTIFICATION.unique()
[In] company_id
[OUT] array(['BBG000QFYJ26', 'BBG000C0ZQY2', 'BBG000LNZ408', ..., 'BBG000QXGV57',
'BBG0022MJRB2', 'BBG0025394S5'], dtype=object)
I created a simple loop, but I don't think it's working correctly.
for i in company_id:
i = pd.DataFrame()
As a test, I had it print i after each iteration.
for i in company_id:
i = pd.DataFrame()
print(i)
Output was:
Index: []
Empty DataFrame
Columns: []
Index: []
Empty DataFrame
Columns: []
etc.
I also can't call the datframes by the names I know are in the array. Thoughts?