Django: ConnectionAbortedError: [WinError 10053]

我对这个警告感到绝望。我正在做以下事情:


groups = df.groupby('year')

2018_group = groups.get_group('2018')


if not 2018_group['Descripcion'].empty:

    desc = 2018_group.loc[2018_group['Descripcion'].notnull(), 'Desc'].copy()

    2018_group.loc[:, 'Descripcion'] = desc.unique()[0]

    print 2018_group

获取已知错误:


SettingWithCopyWarning: 

A value is trying to be set on a copy of a slice from a DataFrame


See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy

  2018_group.loc['Desc'] = desc.unique()[0]

我想要做的是用该列中的非空值填充列“Desc”


Smart猫小萌
浏览 341回答 2
2回答

泛舟湖上清波郎朗

您已设置使用相同语言的查询和数据库。然而,虽然 DB 使用的代码页有 850 个可能的字符,但您的会话有 1252 个可能的字符。当两者尝试通信时,查询和数据库之间存在无法匹配的符号。cmd.exe /c chcp 1252 -> 将查询语言设置为 1252 个可能的字符 == db(1252 个可能的字符),从而解决了该问题。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python