logo
  • 教程列表
  • SO官方文档
  • 创建 DataFrame
    • 创建一个示例 DataFrame
    • 使用 Numpy 创建示例 DataFrame
    • 使用 datetime 创建示例 DataFrame
    • 使用 MultiIndex 创建示例 DataFrame
    • 从元组列表中创建 DataFrame
    • 从字典列表中创建 DataFrame
    • 使用 Dictionary 从多个集合创建示例 DataFrame
    • 从列表字典创建 DataFrame
    • 以 pickle(.plk) 格式保存并加载 DataFrame
  1. StackOverflow 文档
  2. pandas 教程
  3. 创建 DataFrame
  4. 使用 Dictionary 从多个集合创建示例 DataFrame

使用 Dictionary 从多个集合创建示例 DataFrame

Created: November-22, 2018

import pandas as pd
import numpy as np

np.random.seed(123) 
x = np.random.standard_normal(4)
y = range(4)
df = pd.DataFrame({'X':x, 'Y':y})
>>> df
          X  Y
0 -1.085631  0
1  0.997345  1
2  0.282978  2
3 -1.506295  3
  • 从列表字典创建 DataFrame
  • 从字典列表中创建 DataFrame

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明