首页 > 解决方案 > How do you separate a column with words not separated at all. The data loaded from pd.read_table?

问题描述

So I uploaded a data from pd.read_table:

df = pd.read_table('Test_Data.txt', delim_whitespace=True, names=('A', 'B'))
    

and the data is:

    A                                                   B
0   AAABBABAABBAAABBBBAABBBABAAABAAAAABBBABBBAAABB...   True
1   AABAABABBBABAAAAABAAABBAABAABBABABBAAABABBBBAB...   True
2   BAAABBBBABABABBBABBAAABAAAAAAABBBBAABABABBBAAB...   True
3   BAABBABBABBAAAABABBBAAAAAAAABAAABBAAAABBAABBAA...   True
4   ABBABBBABBAABAABABBAAABAAAAABABABAABBAABBBAABA...   True

Column A is 100 alphabets. I want to split each in separate columns. I want to have 100 columns of these alphabets and column B as it is. How must I do that?

Thank you!

标签: pythonpandasdataset

解决方案


You can use fixed width text to column converting option.

Data > Text to Column >

Excel will let you put pointer where you want the separation to applied.enter image description here


推荐阅读