![](https://glutech.net/wp-content/uploads/2021/03/image-23.png)
anacondaでpython入れたらpandasも入ってるらしい。取り敢えず、pandasをimportしてから、pandas.test()してみるといいとのことだったので試した。
まぁ、関連ライブラリが古いと。
![](https://glutech.net/wp-content/uploads/2021/03/image-24.png)
そもそもインストールされてないぽい。インストールして再度test。
![](https://glutech.net/wp-content/uploads/2021/03/image-25.png)
うーむ。時刻関係で死んでる。ただ、動きそうな気配はあるからEXCEL連携試してみる。
openpyxlを入れれば、2007以降のxlsx、xlsmを扱えるとのこと。それ以前のxlsはxlrd, xlwtとからしい。
![](https://glutech.net/wp-content/uploads/2021/03/image-26-1024x125.png)
anacondaで見るとインストール済み。
![](https://glutech.net/wp-content/uploads/2021/03/image-27-1024x311.png)
import os
import pandas
os.chdir("c:\\")
print(os.getcwd())
df = pandas.DataFrame([[2.2, 0.1, 16.8], [8, 6.2, 4], [23.2, 3.1, 4]], index=['糀甘酒', '豆乳', 'プロテイン'], columns=['たんぱく質', '脂質', '炭水化物'])
print(df)
df.to_excel('sandbox/excel_test.xlsx')
![](https://glutech.net/wp-content/uploads/2021/03/image-28.png)
ファイル出力された。
![](https://glutech.net/wp-content/uploads/2021/03/image-29.png)
おっし!出力された!!!
コメント