6
的pd.DataFrame
文檔字符串指定爲整個數據幀的標參數:初始化大熊貓數據幀具有定義dtypes
dtype : dtype, default None Data type to force, otherwise infer
看似它確實旨在是一個標量,如以下導致的錯誤:
dfbinseq = pd.DataFrame([],
columns = ["chr", "centre", "seq_binary"],
dtype = ["O", pd.np.int64, "O"])
dfbinseq = pd.DataFrame([],
columns = ["chr", "centre", "seq_binary"],
dtype = [pd.np.object, pd.np.int64, pd.np.object])
對我而言,創建一個空數據框(我需要在HDF5存儲中進一步存儲append
s)的唯一解決方法是
dfbinseq.centre.dtype = np.int64
有沒有辦法一次設置dtypes
參數?