Skip to content

.loc[] = pd.Series({...}) segmentation fault #21968

Open
@kuraga

Description

@kuraga

Code Sample, a copy-pastable example if possible

test.csv:

"A","B"
"Давид Юрченко","Tosno"
"Евгений Чернов","Tosno"
"Раде Дугалич","Tosno"
"Виталий Шахов","Tosno"
"Аслан Дудиев","Tosno"
"Вагиз Галиулин","Tosno"
"Нуну Роша","Tosno"
"Георгий Мелкадзе","Tosno"

test.py:

import pandas as pd

df = pd.read_csv('test.csv', sep=',').set_index('A', drop=False)

for s in [
'Евгений Чернов',
'Раде Дугалич',
'Виталий Шахов',
'Аслан Дудиев',
'Александр Карницкий',
'Вагиз Галиулин',
'Нолан Ру'
    ]:
    df.loc[s] = pd.Series({ 'A': 'value' })

Problem description

This code sometimes causes a segmentation fault.

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.5.final.0 python-bits: 64 OS: Linux OS-release: 4.14.39-calculate machine: x86_64 processor: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz byteorder: little LC_ALL: None LANG: ru_RU.utf8 LOCALE: ru_RU.UTF-8

pandas: 0.23.0
pytest: None
pip: 9.0.3
setuptools: 39.0.1
Cython: None
numpy: 1.14.3
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.4.0
sphinx: None
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.6.0
html5lib: 0.9999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

cc @TomAugspurger

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselvesSegfaultNon-Recoverable Error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions