{"id":1295,"date":"2020-04-20T01:50:02","date_gmt":"2020-04-19T16:50:02","guid":{"rendered":"https:\/\/ts-engine.net\/?p=1295"},"modified":"2020-04-20T01:50:02","modified_gmt":"2020-04-19T16:50:02","slug":"python-dataframe%e3%81%ae%e6%9b%b8%e3%81%8d%e8%be%bc%e3%81%bf%e8%aa%ad%e3%81%bf%e8%be%bc%e3%81%bf","status":"publish","type":"post","link":"http:\/\/ts-engine.net\/?p=1295","title":{"rendered":"Python DataFrame\u306e\u66f8\u304d\u8fbc\u307f\u8aad\u307f\u8fbc\u307f"},"content":{"rendered":"<p>\n\u8da3\u5473\u3067\u66f8\u3044\u3066\u3044\u308b\u30a2\u30d7\u30ea\u3067WebAPI\u304b\u3089\u30c7\u30fc\u30bf\u3092\u3082\u3063\u3066\u304d\u3066\u3001\u305d\u306e\u30c7\u30fc\u30bf\u3092\u6574\u5f62\u3059\u308b\u305f\u3081\u306b\u3044\u3063\u305f\u3093pandas\u306eDataFrame\u306b\u3044\u308c\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3092\u3088\u304f\u3042\u308b\u3068\u601d\u3046\u3002\n<\/p>\n<p>\n\u79c1\u3082\u3088\u304f\u3042\u308b\u304c\u3001DataFrame\u306e\u6319\u52d5\u3092\u8a66\u3057\u306a\u304c\u3089\u3084\u3063\u3066\u3044\u308b\u3068\u3001\u305d\u306e\u305f\u3073\u306b\u3001WebAPI\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001DataFrame\u306b\u3044\u308c\u3066\u3068\u3044\u3046\u51e6\u7406\u306b\u306a\u308a\u3001WebAPI\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306b\u3088\u308b\u9045\u5ef6\u3082\u3042\u308b\u3057\u3001API\u306eLimit\u306b\u3072\u3063\u304b\u304b\u308b\u3001\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u8acb\u6c42\u3055\u308c\u308b\u5834\u5408\u3082\u3042\u308b\u306e\u3067\u3001WebAPI\u304b\u3089DataFrame\u306b\u30c7\u30fc\u30bf\u3092\u5165\u308c\u305f\u3042\u3068\u306f\u30ed\u30fc\u30ab\u30eb\u306b\u8aad\u307f\u66f8\u304d\u51fa\u308b\u3088\u3046\u306b\u3057\u305f\u3002\n<\/p>\n<p><!--more--><\/p>\n<h2>\nDataframe\u306e\u8aad\u307f\u66f8\u304d<br \/>\n<\/h2>\n<p>[python]<br \/>\nimport pandas as pd<\/p>\n<p># Write<br \/>\n# df\u306f\u3059\u3067\u306b\u8aad\u307f\u8fbc\u307f\u305a\u307fdataframe\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<br \/>\ndf.to_pickle(&#8220;df_output.pkl&#8221;)<\/p>\n<p># Read<br \/>\ndf = pd.read_pickle(&#8220;df_output.pkl&#8221;)<br \/>\n[\/python]<\/p>\n<h2>\n.csv\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u3082\u3044\u3044\u304c\u3001Dataframe\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020\u306b\u306a\u3063\u3066\u3044\u308b\u3076\u3093\u697d\u3067\u3042\u308b\u3002<br \/>\n<\/h2>\n<p>\n\u4f8b\u3048\u3070Dataframe\u3067\u30c7\u30fc\u30bf\u306e\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u3092\u3057\u3066\u3044\u308b\u7d4c\u904e\u3067\u3082\u66f8\u304d\u51fa\u305b\u308b\u306e\u3067\u3001\u697d\u3060\u3057\u3001csv\u69cb\u9020\u306b\u51fa\u529b\u3001\u5165\u529b\u3068\u3044\u3046\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u3082\u306a\u3044\u306e\u3067\u3053\u306e\u307b\u3046\u304c\u304a\u3059\u3059\u3081\u3067\u3042\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8da3\u5473\u3067\u66f8\u3044\u3066\u3044\u308b\u30a2\u30d7\u30ea\u3067WebAPI\u304b\u3089\u30c7\u30fc\u30bf\u3092\u3082\u3063\u3066\u304d\u3066\u3001\u305d\u306e\u30c7\u30fc\u30bf\u3092\u6574\u5f62\u3059\u308b\u305f\u3081\u306b\u3044\u3063\u305f\u3093pandas\u306eDataFrame\u306b\u3044\u308c\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u3092\u3088\u304f\u3042\u308b\u3068\u601d\u3046\u3002 \u79c1\u3082\u3088\u304f\u3042\u308b\u304c\u3001DataFrame\u306e\u6319\u52d5\u3092\u8a66\u3057\u306a\u304c\u3089\u3084\u3063\u3066\u3044\u308b\u3068\u3001\u305d\u306e\u305f\u3073\u306b\u3001WebAPI\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001DataFrame\u306b\u3044\u308c\u3066\u3068\u3044\u3046\u51e6\u7406\u306b\u306a\u308a\u3001WebAPI\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306b\u3088\u308b\u9045\u5ef6\u3082\u3042\u308b\u3057\u3001API\u306eLimit\u306b\u3072\u3063\u304b\u304b\u308b\u3001\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u8acb\u6c42\u3055\u308c\u308b\u5834\u5408\u3082\u3042\u308b\u306e\u3067\u3001WebAPI\u304b\u3089DataFrame\u306b\u30c7\u30fc\u30bf\u3092\u5165\u308c\u305f\u3042\u3068\u306f\u30ed\u30fc\u30ab\u30eb\u306b\u8aad\u307f\u66f8\u304d\u51fa\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,7],"tags":[],"class_list":["post-1295","post","type-post","status-publish","format-standard","hentry","category-20","category-7"],"_links":{"self":[{"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/posts\/1295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ts-engine.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1295"}],"version-history":[{"count":0,"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/posts\/1295\/revisions"}],"wp:attachment":[{"href":"http:\/\/ts-engine.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ts-engine.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1295"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ts-engine.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}