小编sre*_*rai的帖子

AttributeError:未知属性color_cycle

我正在学习'熊猫'并试图绘制id列,但我得到一个错误AttributeError: Unknown property color_cycle和空图.该图仅显示在交互式shell中.当我作为脚本执行时,我得到相同的错误,除了图形没有出现.

以下是日志:

>>> import pandas as pd
>>> pd.set_option('display.mpl_style', 'default')
>>> df = pd.read_csv('2015.csv', parse_dates=['log_date'])
>>> employee_198 = df[df['employee_id'] == 198]
>>> print(employee_198)
          id  version  company_id early_minutes  employee_id late_minutes  \
90724  91635        0           1           NaN          198          NaN
90725  91636        0           1           NaN          198      0:20:00
90726  91637        0           1       0:20:00          198          NaN
90727  91638        0           1       0:05:00          198          NaN
90728  91639        0           1       0:25:00          198          NaN
90729  91640        0           1       0:15:00          198      0:20:00
90730 …
Run Code Online (Sandbox Code Playgroud)

python matplotlib pandas

6
推荐指数
1
解决办法
9440
查看次数

如何在Python中拆分此字符串?

我有一个变量string.

string = '''Layer:defaultRenderLayer
Line 1 text goes here
Line 2 text goes here
Line 3 text goes here
Layer:diffuse
Line 1 text goes here
Line 2 text goes here
Line 3 text goes here
Line 4 text goes here
Line 5 text goes here
Layer:outline
Line 1 text goes here
Line 2 text goes here'''
Run Code Online (Sandbox Code Playgroud)

我试图在文本之前分割字符串,Layer如下所示.

string_list = [
    'Layer:defaultRenderLayer\nLine 1 text goes here\nLine 2 text goes here\nLine 3 text goes here',
    'Layer:diffuse\nLine 1 text …
Run Code Online (Sandbox Code Playgroud)

python

2
推荐指数
1
解决办法
71
查看次数

标签 统计

python ×2

matplotlib ×1

pandas ×1