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

  • 關於本站
  • 免責聲明