我想要回合pandas.DataFrame
。圓形pandas.DataFrame的正確方法?
這裏是我到目前爲止已經試過:
import pandas as pd
data = pd.DataFrame([1.4,2.5,3.8,4.4,5.6],[6.2,7.6,8.8,9.1,0])
print(round(data))
但是當我運行這段代碼,我得到以下錯誤:
Traceback (most recent call last):
File "C:\Users\*****\Documents\*****\******\****.py", line 3, in <module>
print(round(data))
TypeError: type DataFrame doesn't define __round__ method
什麼是圓pandas.DataFrame
的正確方法?
Dup of http://stackoverflow.com/q/19100540/564538 –