小编kal*_*own的帖子

Pandas groupby to to_csv

想要将数据帧输出Pandas group到CSV.尝试了各种StackOverflow解决方案,但它们没有奏效.

Python 3.6.1,Pandas 0.20.1

groupby结果如下:

id  month   year    count
week                
0   9066    82  32142   895
1   7679    84  30112   749
2   8368    126 42187   872
3   11038   102 34165   976
4   8815    117 34122   767
5   10979   163 50225   1252
6   8726    142 38159   996
7   5568    63  26143   582
Run Code Online (Sandbox Code Playgroud)

想要一个看起来像的csv

week  count
0   895
1   749
2   872
3   976
4   767
5   1252
6   996
7   582
Run Code Online (Sandbox Code Playgroud)

当前代码:

week_grouped = df.groupby('week')
week_grouped.sum() #At this point you have …
Run Code Online (Sandbox Code Playgroud)

python csv pandas pandas-groupby

7
推荐指数
3
解决办法
2万
查看次数

Unity - 如何重置 ExecuteInEditMode 脚本的检查器值?

我想恢复默认值,而无需关闭并重新启动 Unity。

当我在 VSC 中保存时,检查器中的字段保持不变。让它们重置的唯一方法是关闭并重新启动 Unity。我是否需要更改代码、Unity 中的设置或 Visual Studio Code 中的设置才能使检查器面板和内容恢复为原始状态?

在此输入图像描述

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[ExecuteInEditMode]
public class DebugGizmos : MonoBehaviour
{
 [SerializeField]
 private float innerRadius = 1.0f;

 [SerializeField]
 private float outerRadius = 10.0f;

 [SerializeField]
 private float angle = 10.0f;

 [SerializeField]
 private float gap = 10.0f;

 [SerializeField]
 private int segments = 10;

 [SerializeField]
 private float height = 1;

 // Debugging var for drawing Gizmos
 private Vector3 vLI, vLO, vUI, vUO;
 private List<Vector3> liaPts, loaPts, uiaPts, uoaPts;

 void OnDrawGizmos() …
Run Code Online (Sandbox Code Playgroud)

c# unity-game-engine

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

标签 统计

c# ×1

csv ×1

pandas ×1

pandas-groupby ×1

python ×1

unity-game-engine ×1