使用python中的特定格式从数据框创建嵌套字典

时间:2020-04-13 05:44:56

标签: python pandas dataframe dictionary

我在python中有数据框

import numpy as np


def unmasked_call(func):
    def func2(*args, **kwargs):
        with np.errstate(all='raise'):
            return func(*args, **kwargs)
    return func2


@unmasked_call
def one():
    print ("One:")
    return np.max([1, 2, np.nan])


print ("Starting")
one()

我想将其转换为以下给定格式的嵌套字典

    date          value
0   10/3/2019     15
1   11/3/2019     34
2   12/3/2019     36
3   13/3/2019     52
and so on...

0 个答案:

没有答案
相关问题