Skip to main content
本文に 2 文字追加
ソース リンク
metropolis
  • 6,705
  • 2
  • 6
  • 16
import pandas as pd
from pprint import pprint

data_list_ACF_2 = [
    [-0.01, 37.225, 49.526255],
    [-0.0098, 37.225, 11.429136],
    [-0.0096, 37.225, 7.31264],
    [-0.0094, 37.225, 2.089326],
    [-0.01, 37.225, 37.288825]]

df = pd.DataFrame(data=data_list_ACF_2)
data_list_ACF_3 = df.groupby([0, 1], sort=False, as_index=False)[2].sum().reset_index().values.tolist()

pprint(data_list_ACF_3)

#
[[-0.01, 37.225, 86.81508],
 [-0.0098, 37.225, 11.429136],
 [-0.0096, 37.225, 7.31264],
 [-0.0094, 37.225, 2.089326]]
import pandas as pd
from pprint import pprint

data_list_ACF_2 = [
    [-0.01, 37.225, 49.526255],
    [-0.0098, 37.225, 11.429136],
    [-0.0096, 37.225, 7.31264],
    [-0.0094, 37.225, 2.089326],
    [-0.01, 37.225, 37.288825]]

df = pd.DataFrame(data=data_list_ACF_2)
data_list_ACF_3 = df.groupby([0, 1], sort=False)[2].sum().reset_index().values.tolist()

pprint(data_list_ACF_3)

#
[[-0.01, 37.225, 86.81508],
 [-0.0098, 37.225, 11.429136],
 [-0.0096, 37.225, 7.31264],
 [-0.0094, 37.225, 2.089326]]
import pandas as pd
from pprint import pprint

data_list_ACF_2 = [
    [-0.01, 37.225, 49.526255],
    [-0.0098, 37.225, 11.429136],
    [-0.0096, 37.225, 7.31264],
    [-0.0094, 37.225, 2.089326],
    [-0.01, 37.225, 37.288825]]

df = pd.DataFrame(data=data_list_ACF_2)
data_list_ACF_3 = df.groupby([0, 1], sort=False, as_index=False)[2].sum().values.tolist()

pprint(data_list_ACF_3)

#
[[-0.01, 37.225, 86.81508],
 [-0.0098, 37.225, 11.429136],
 [-0.0096, 37.225, 7.31264],
 [-0.0094, 37.225, 2.089326]]
ソース リンク
metropolis
  • 6,705
  • 2
  • 6
  • 16

import pandas as pd
from pprint import pprint

data_list_ACF_2 = [
    [-0.01, 37.225, 49.526255],
    [-0.0098, 37.225, 11.429136],
    [-0.0096, 37.225, 7.31264],
    [-0.0094, 37.225, 2.089326],
    [-0.01, 37.225, 37.288825]]

df = pd.DataFrame(data=data_list_ACF_2)
data_list_ACF_3 = df.groupby([0, 1], sort=False)[2].sum().reset_index().values.tolist()

pprint(data_list_ACF_3)

#
[[-0.01, 37.225, 86.81508],
 [-0.0098, 37.225, 11.429136],
 [-0.0096, 37.225, 7.31264],
 [-0.0094, 37.225, 2.089326]]