Skip to content

string truncation when using Series.astype(str) #4405

Closed
@mariusvniekerk

Description

@mariusvniekerk

When converting a pandas Series object to type string using astype(str), long strings are truncated to 64 characters silently.

Pandas version: 0.12
Numpy version: 1.7.1

In [1]: s = '0123456789' * 10

In [2]: tmp = np.array([s]).astype(str)
         tmp
Out[2]: array([ '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'], 
      dtype='|S100')

In [3]: tmp = pd.Series([s]).astype(str)
       tmp[0]
Out[3]: '0123456789012345678901234567890123456789012345678901234567890123'

In [4]: len(tmp[0])
Out[4]: 64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions