Skip to content

Segfault when modifying pandas.DataFrame in-place after creating from numpy recarray #6026

Closed
@bburan-galenea

Description

@bburan-galenea

The following code generates a segfault when use_records is True. This segfault only occurs when the DataFrame is generated from a record array and then I attempt to modify the series in-place. This was not an issue in the previous release (v0.12) of Pandas. Tested this code against 0.13.0-268-g08c1302.

import numpy as np
import pandas

data = [('right', 'left', 'left', 'left', 'right', 'left', 'timeout')]

use_records = True
if use_records:
    recarray = np.rec.fromarrays(data, names=['response'])
    df = pandas.DataFrame(recarray)
else:
    df = pandas.DataFrame({'response': data[0]})
mask = df.response == 'timeout'
df.response[mask] = 'none'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugInternalsRelated to non-user accessible pandas implementation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions