Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
ãã¡ããã覧ãã ãããè¸ã¿çµµã§ã¯ããã¾ãããRä¸ã§å°ç空éãã¼ã¿ãæ±ãPythonã¢ã¸ã¥ã¼ã«ãgeopandasã«ããä½å³ãè¡ãªã£ã¦ããç»é¢ã§ãã ããRã§Pythonã!?ã¨é©ãããæ¹ãããããããã¾ããããreticulateã¨ããRããã±ã¼ã¸ã使ããã¨ã§ãã»ã¼ã¹ãã¬ã¹ããªã¼ã§Pythonã®ã¢ã¸ã¥ã¼ã«ãé¢æ°ãRä¸ã§å©ç¨å¯è½ã«ãªãã¾ããå ã®å³ã¯æ¬¡ã®ã³ã¼ãã«ãã£ã¦å®è¡ããã¾ããã library(reticulate) # ã¢ã¸ã¥ã¼ã«ã®å¼ã³åºã gpd <- import("geopandas") plt <- import("matplotlib.pyplot") # ãµã³ãã«ãã¼ã¿ã®èªã¿è¾¼ã¿ world <- gpd$read_file(gpd$datasets$get_path("naturalearth_lowres")) # ãã¼ã¿ã»ããã®ç¢ºèª head(world) # ã§ã¯ãª
pythonã®Pandasãã¼ã¿ãã¬ã¼ã ã§ã以ä¸ã®ãããªãã¼ã¿ãããã¾ãã ãããã以ä¸ã®ããã«å¤æããæ¹æ³ãç¥ãããã§ãã x={'item1':1,'item2':1,'item4':1} y={'item1':1,'item3':1} ã¡ãªã¿ã«ãããã§å®è¡ããã°ã0ãã®å¤ãå«ã¾ãã¦ãã¾ããæããããã§ãã In:dict(df.ix['x']) Out:{'item1': 1, 'item2': 1, 'item3': 0, 'item4': 1} 説æãä¸è¶³ãã¦ããã°è£è¶³ãã¾ãã®ã§ãåçããã ããã°ãããããã§ãã ãããããé¡ããã¾ãã
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? #!/usr/bin/env python # -*- coding: utf-8 -*- # ã¤ã³ãã¼ã import numpy as np import scipy as py import pandas as pd import itertools as it ''' ä½æ ''' # ãªã¹ãä½æ list_value = [10,11,12] list_value Out[374]: [10, 11, 12] # ã¿ãã«ä½æ tuple_value = (10,11,12) tuple_value Out[375]: (10,
以ä¸ã¯ç§ã® .zshrc ãã z.sh ã®åä½ã«å¿ è¦ãªé¨åãæç²ãããã®ã§ããå¤ããã¼ã¸ã§ã³ã® zsh ã§ãåä½ããããããç´æ¥ã¹ã¯ãªããã®åä½ã«é¢ããã®ç¡ãé¨åãè¨è¼ãã¦ãã¾ãã ã¹ã¯ãªãã㯠$ZDOTDIR/z/z.sh ã«é ç½® z ã ã¨ã¿ã¤ããã¥ããã®ã§ j ã«å¤æ´ è¨é²ãã¡ã¤ã«ã¯ $ZDOTDIR/.z ã«å¤æ´ :a ã :A ãªã©ã®å¤æ°å±éå¶å¾¡ç·¨éåã使ç¨ã§ããªããã¼ã¸ã§ã³ã§ã¯ç¬èªã«ããã¯é¢æ°ãå®ç¾© autoload -Uz is-at-least # Treat hook functions as array typeset -ga chpwd_functions typeset -ga precmd_functions typeset -ga preexec_functions # Simulate hook functions for older versions if
>>> import numpy as np >>> a = np.array([[1,2,3], [4,5,6]]) >>> b = np.array([[7, 8, 9], [10, 11, 12]]) >>> c = np.array((1, 2, 3)) >>> d = np.array((4, 5, 6)) >>> a array([[1, 2, 3], [4, 5, 6]]) >>> b array([[ 7, 8, 9], [10, 11, 12]]) >>> c array([1, 2, 3]) >>> d array([4, 5, 6]) >>> np.r_[a, b] array([[ 1, 2, 3], [ 4, 5, 6], [ 7, 8, 9], [10, 11, 12]]) >>> np.c_[a, b] array([[ 1, 2, 3, 7, 8, 9],
Pythonã使ã£ã¦ãã®æ¹ãã¾ãã¾ãªç¹ã«ã¤ã¾ãããããããã§ã¯ãããªãã©ãããåé¿ãã¦å¿«é©ãªPython Lifeãéã£ã¦ããã ãã¹ããæ¸ãå§ããåã«ç¥ã£ã¦ããã°ããã£ãã¨ããTipsãã¾ã¨ãã¦ããã Python2ç³»ã¨3ç³»ã«ã¤ã㦠Pythonã«ã¯2ç³»ã¨3ç³»ãããã3ç³»ã§ã¯å¾æ¹äºææ§ã«å½±é¿ã®ããå¤æ´ãå ¥ãããã¦ãããã¤ã¾ããPython3ã®ã³ã¼ãã¯Python2ã§ã¯åããªããã¨ããã(éãããã)ã Python3ã§ã¯Python2ã«ãããæ§ã ãªç¹ãæ¹åããã¦ãããä»ãã使ããªãææ°çã®Python3ã§è¡ãã®ãåºæ¬ã (ä¸è¨ã§ããPython3ã§æ¹åããããã®ã¯æè¨ããããã«ãã)ãä½ãããPython2ã¯2020å¹´1æ1æ¥ããã£ã¦ãµãã¼ããçµäºããããã£ã¦ä»ããPython2ã使ãçç±ã¯ãªããæªã ã«Python2ã使ãè ã¯ãå°å¦çã«ããã£ã¹ãããã ããããä¸ã®ä¸ã«ã¯ã¾ã Python3ã«
èæ¯ pythonã«ã¯æ¨æºã¢ã¸ã¥ã¼ã«ã®ä¸ã«unittestãå«ã¾ããã®ã§ããã使ãæ¹ãããã«åãããªãã£ããããä»ã®ããã¸ã§ã¯ãã§ãã³ããã§ããããã«ãã³ãã¬ã¼ããåå¿é²ã¨ãã¦æ®ãã¦ããã¾ãã *注æäºé python2.7以ä¸ããunittestã§ã¯setUpClass, tearDownClassã¨ãããã¹ãã¯ã©ã¹ã®åæåæã«å®è¡ãããã¡ã½ãããç¨ãããã¨ãã§ããããã«ãªãã¾ããã python2.6以ä¸ã®å ´åã¯ãunittest2ã¨ããã¢ã¸ã¥ã¼ã«ãã¤ã³ãã¼ããããã¨ã§ãããã®ã¡ã½ããã使ããã¨ãã§ãã¾ãã ã³ã¼ãã®ãã³ãã¬ã¼ã ãã¤ã³ã unittest.main()ã§ã¯ãsetUpClass â (setUp â tearDown) *ã«ã¼ã â tearDownClass ãå®è¡ããã¾ãã testç¨ã®ã¡ã½ããã¯ååã®å é ã test ããå§ããªããã°ãªãã¾ãããe.g. tes
import unittest import sample class TestSample(unittest.TestCase): def test_add(self): self.assertEqual(sample.add(1, 2), 3) if __name__ == "__main__": unittest.main() ãã¹ãã®å®è¡æ¹æ³ python -m unittest tests.test_sample ã¨unittestã®ã¹ã¯ãªããã§å®è¡ãã å¦ãã ã㨠ä¸è¨ã®æ¹æ³ã§ä¸æããã¹ããå®è¡ã§ããã®ã§ããã以ä¸ã®ç¹ãå¦ã³ã¾ããã __init__.py ã£ã¦ä½ï¼ã¨æãã¾ãããããã®ãã¡ã¤ã«ããããã£ã¬ã¯ããªã¯pythonã®ããã±ã¼ã¸ã¨ãã¦æ±ãããããã§ãããã®ããsample.pyããããã£ã¬ã¯ããªããå®è¡ã³ãã³ãã§ããtests.test_sampleãã®ãtests.ã
Python ã«ãããã¿ã¤ã ã¾ã¼ã³ã®åãæ±ãã«ã¤ãã¦ãæ£ç¢ºã«æ¸ããã¨ããã¨ãªããªãé£ããã®ã§ãä»åãã£ããã¨ã ãã·ã³ãã«ã«æ¸ãããã¨æãã¾ãã Python ã§ã¿ã¤ã ã¾ã¼ã³ãæ±ãã®ã¯é£ãããæ¨æºã©ã¤ãã©ãªã«ã¯ tzinfo ã¨ããã¿ã¤ã ã¾ã¼ã³ã表ãããã®æ½è±¡ã¯ã©ã¹ãç¨æããã¦ããã ããªã®ã§ããããç¶æ¿ãã¦èªåã§ã¿ã¤ã ã¾ã¼ã³ç¨ã®ã¯ã©ã¹ãå®ç¾©ããå¿ è¦ããããä¾ãã°ãããªæãã ã from datetime import timedelta, tzinfo class JST(tzinfo): def utcoffset(self, dt): return timedelta(hours=9) def dst(self, dt): return timedelta(0) def tzname(self, dt): return 'JST' ç¾å¨ã®æ¥æãæ¥æ¬æ¨æºæ(JST)ã§åå¾ãããå ´åã¯ããã
Python ã® datetime ãªãã¸ã§ã¯ã㨠Unix æé (Unix time / Epoch time) ãç¸äºå¤æããæ¹æ³ã«ã¤ãã¦ã¾ã¨ãã¾ã. Python ã® datetime ãªãã¸ã§ã¯ãã«ã¯ã¿ã¤ã ã¾ã¼ã³æ å ±ãä»ãã¦ãããã® (aware) ã¨ä»ãã¦ããªããã® (naive) ãããã®ã§æ³¨æãå¿ è¦ã§ã. Unix æé (Unix time) 㯠UTC ã§ã® 1970/1/1 00:00:00 ããã®çµéç§æ°ã§è¡¨ããã¾ã. å¤ãã®ã·ã¹ãã ã§ã¯éç§ã®åå¨ãèæ ®ããªãå®è£ ã¨ãªã£ã¦ããããã§, ãã®å ´å Unix time 㨠UTC, JST ã®å¯¾å¿ã¯ä»¥ä¸ã®ããã«ãªãã¾ã. Unix time UTC JST (UTC+9) ânaiveâ 㨠âawareâ Python ã® datetime ãªãã¸ã§ã¯ãã«ã¯ ânaiveâ 㨠âawareâ ã®2種é¡ã®ãªãã¸ã§ã¯ãã
datetime ã¢ã¸ã¥ã¼ã«ã¯ Python ã®æ¨æºã©ã¤ãã©ãªã®ä¸ã§ãã使ç¨é »åº¦ãé«ãå²ã«ç½ ãå¤ãã£ãã使ãæ¹ãé£ããã£ããããããã¾ãã¤ã±ã¦ãªãã¢ã¸ã¥ã¼ã«ã ã¨å人çã«æã£ã¦ãã¾ãã ãã㪠datetime ã¢ã¸ã¥ã¼ã«ã§ããã Python 2 ã®ããã¸ã§ã¯ãã Python 3 ã«ç§»è¡ããæã«å¤§åã³ã¼ããæ´çã§ãã¦ã¡ãã£ã¨æåããã®ã§ç´¹ä»ãã¦ããã¾ãã unixtime ã¨ã®ç¸äºå¤æ unixtime ãã datetime.datetime ã¸ã®å¤æã¯ã ãã¼ã«ã«ã¿ã¤ã ãªã.fromtimestamp() ã§ã UTC ãªã .utcfromtimestamp() é¢æ°ã§è¡ãã¾ãã >>> import time >>> from datetime import datetime >>> now = time.time() >>> now 1415542873.099776 >>>
Pythonã®asyncioãã¾ãasync/awaitã«ã¤ãã¦ã¯ãã¾ãå®è·µçãªä¾ãåºåã£ã¦ããªãã£ããããåéããæ å ±ããã¨ã«ç¨ä¾ãã¼ã¹ã®éå¼ããªãã¡ã¬ã³ã¹ãä½ã£ã¦ã¿ã¾ããã ãã ããã®è¾ºã¯ã»ãã¨ã«æ å ±ããªãã¦ä½ãçå®ãªã®ãè¬ã«å ã¾ãã¦ããç¹ãããã®ã§ãæ å ±ããæã¡ã®æ¹ã¯ãã²ãé£çµ¡ãããã ããã°ã¨æãã¾ãã ä»åç´¹ä»ããä¾ã¯ã以ä¸ã®gistã«ã¾ã¨ãã¦ããã¾ããå®è£ æã®åèã«ãã¦ããã ããã°ã¨æãã¾ãã icoxfog417/asyncio_examples.py ã¯ããã« Pythonã«ã¯threadingãmultiprocessingãasyncioã¨ã©ãã並åå¦çã«ä½¿ããããªããã±ã¼ã¸ã3ã¤ããã¾ãããããã®éããã¾ãæ¼ããã¦ããã¾ãã ãããã®ããã±ã¼ã¸ã®éãã¯ããã®ã¾ã¾ããã«ãã¹ã¬ããããããã«ãããã»ã¹ããããã³ããããã³ã°ãã®éãã«ç¸å½ãã¾ããã¾ãããã«ãã¹ã¬ããã¨ãã«ãã
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? åæ© ããããããªã§ãããæ©æ¢°å¦ç¿ã®åå¼·ã«ã¯ã¨ã¦ãæéãæããã¾ãã ã§ããåãåå¼·æéãè²»ãããã¨ãã¦ããææã®è¯ãæªãã§æãæ¹ã大ããå¤ãã£ã¦ãããã¨ã¯ã誰ããå®æãã¦ãããã¨ã ã¨æãã¾ãã ããã§ãæ¬è¨äºã§ã¯ãã¼ããã¨ã«ç§ãèããæå¼·ã®æç§æ¸ããªã¹ããã¦ãããã¨æãã¾ãã ãã£ã¼ãã©ã¼ãã³ã°ï¼ã¢ã«ã´ãªãºã ã®çè§£ï¼ ãDeep LearningãAn MIT Press book, 2016/12 çºè¡ http://www.deeplearningbook.org/ å°å·æ¬ã売ããã¦ã¾ãããä¸ã®Webãã¼ã¸ã§ãã¤ã§ãã¿ãã§èªãã¾ã
ã¯ãã㫠追è¨2020/09/25: KaoriyaçVimã¯ç¾å¨32bit/64bitã¨ãã«python2ãµãã¼ãããªãããslimvãåä½ãã¾ããã ãã®ãã¡ãã¡ãã¨æ¤è¨¼ãããã¤ããã§ããã Windowsç°å¢ä¸ã§vimã§lispããç°å¢ã欲ããã ããªãä¸è¨ã®neovim+vlimeã®ã»ããpythonã«ä¾åããªãã®ã§è¯ãã¨æãã¾ã ãã®è¨äºã¯Vimmerãªäººãã¡ã§ãã¤CommonLispå§ãã¦ã¿ããã¨ããæ¹åãã§ãã Lispéçºç¨ã®Vimãã©ã°ã¤ã³ã§ããslimvã使ã£ãç°å¢æ§ç¯ããã¦ããã¾ãã Emacsãªäººãã¡ã¯LispBoxã§èª¿ã¹ãã¨å¹¸ãã«ãªããããããã¾ããã 以åæ¸ããslimvå°å ¥ã¨ããè¨äºã®å 容ã®ç¼ãç´ãçã§ãã Linuxãªäººãã¡ã ãã§ãªãWindowsãªäººãã¡ã®ç°å¢æ§ç¯ã«ã¤ãã¦ãæ¸ãã¦ããããã¨ãããã¾ãã â»Windowsçæ¸ãã¾ãã : Windowsã®ç°å¢æ§
ã¯ããã« Emacsã®ããã¼ã¦ã¼ã¶ã¼ã§ãããªãã¨ãªãæ°åãå¤ãããã¦Atomã触ã£ã¦ã¿ãã®ã§ãã®æã®è¨å®åå¿é²ã§ãï¼ çè ã¯Atomè¶ åå¿è ã§ãã®ã§ééãçãããã¾ããããææãã ããï¼ ãã¼ãã¤ã³ãé¢é£ atomic-emacs emacs-plus ããã ãã§ã»ã¼AtomãEmacsåãã¾ãï¼ãã ãï¼C-kãAtomã§ã¯ãã¬ãã£ãã¯ã¹ã«è¨å®ããã¦ãã¾ã£ã¦ããã®ã§ãããç¡å¹åãã¾ãï¼ disable-keybindings è¨å®ç»é¢ã§Except Community Packagesã«emacs-plus, atomic-emacsã追å ï¼Prefix Keysã«ctrl-kã追å ãã¾ãï¼ ãã以éï¼ããããããã±ã¼ã¸ã®ãã¼ãã¤ã³ããç¡å¹ã«ãªãã®ã§ããã±ã¼ã¸ã追å ãããã³ã«~/.atom/keymap.csonã«è¨å®ã追å ãã¾ãï¼ dired, neotree tree-view aut
èæ¯ Emacsã¯ç¬èªãããã¡ã§ã¤ã³ã¯ï¼ã³ãã¼ï¼ã»ãã¼ã¹ããè¡ã£ã¦ãã¾ãã ããèªä½ã¯ä¾¿å©ãªã®ã§ãããEmacsã®ç°å¢å¤ã¨ã®ããåãã«ã¤ãã¦èæ ®ããå¿ è¦ãããã¾ãã Emacsã§ã¯å¼·å¼ã«ãã©ãã°ãã¦ã¯ãªãããã¼ãã«ã³ãã¼ãããªã©ãã¦ãã¾ããï¼æ¥ããããï¼ã ããã¦æè¿Spacemacsã«ç§»è¡ããã®ã§ããããªãã¨ãããåºæ¥ãªããªã£ã¦ãã¾ããã ãã¾ããã©ãã°ã§ããªãããä½ããOSã®ã³ãã¼ã³ãã³ããç¡å¹ã«ãªã£ã¦ãã¾ãã å¿æ¥å¦ç½®çã«org-modeããhtmlãåºåã»ãã©ã¦ã¶ã«åãåºãã¦ã³ãããã¦ããã®ã§ããã æåã³ã¼ããæ¹è¡ã³ã¼ãã®é½åã§æ±ãããã¥ã¼ãåºãªãã£ããããã®ã§ã ããããéãè °ãä¸ãã¦ã¯ãªãããã¼ãæä½ãEmacsããåºæ¥ãããã«ãããã¨æãç«ã¡ã¾ããã è§£æ±ºæ³ Spacemacsã®issueã§ä¸ãã£ã¦ã¾ããã https://github.com/syl20bnr/space
ELispãã»ã¨ãã©æ¸ãã¦ããªãã®ã§ãæ£ããããæ¹ãªã®ãå ¨ç¶ããããªãããã¨ããããã§ããã ãã xselã®åä½ããã¾ãå®å®ããªããçãããã¹ããªãåé¡ãªããã»ã»ã» ;; Region to X clipboard (defun paste-to-tmp-file(data) (with-temp-buffer (insert data) (write-file "/tmp/clipboard"))) (defun xclip-add-region() (interactive) (if (region-active-p) (progn (paste-to-tmp-file (buffer-substring-no-properties (region-beginning) (region-end))) (shell-command "xsel -ib < /tmp/clipboard")
package example import ( "fmt" ge "github.com/mikeshimura/goexcel" "io/ioutil" "strconv" "strings" "time" ) func Simple1() { list := ReadTextFile("simple1.txt", 8) excel := ge.CreateGoexcel() excel.AddSheetPanic("Sheet1") excel.CreateStyleByKey("base", "Verdana", 10, "", "") //Style TBLR excel.CopyStyle("base", "TBLR") excel.SetBorder("TBLR", "TBLR", ge.BDR_Hair) excel.SetFill("TBLR", ge.PTN_Solid
ã©ãããAndroidã¢ããªã®éçºããã£ã¦ãã¾ããã¨ã³ã¸ãã¢ã®å²©æ¨ï¼@YusukeIwakiï¼ã§ãã 社å ã§ã¯Rubyistãã¡ã«å²ã¾ããªãããå¤ç¬ã«Javaãæ¸ãã¦ãã¾ãï¼èªå¼µï½ï¼ ã¯ã©ã¦ãã¯ã¼ã¯ã¹ã§ã¯ãæ½çã®äºå調æ»ãå¹ææ¤è¨¼ãªã©ã®ãã¼ã¿æ¸¬å®ããã¨ã³ã¸ãã¢ãçå ãã¦ãããªãéçºããã»ã¹ãã¨ã£ã¦ãã¾ãã ãã¼ã¿åéã§ã¯SQLã使ãæ©ä¼ãå¤ãã®ã§ããããä¼å¡ç»é²ãã人ã®ãï¼é±éåä½ã§ã®çºæ³¨çã®æ¨ç§»ãã®ãããªè¤éãªãã¼ã¿ãåããã¨ããæã«ãããã¨ã¤ããæãããããã¨ãå¤ãã£ããããSQLéç¨ã®ã¤ãã¿ã解決ãã¹ãPandasã¨Jupyterã®å¸ææ´»åããããªã£ãï¼ã¨ãã話ãå ±æãã¾ãã ãããã解決ãããã£ã"SQLã®ã¤ãã¿" ããã¼ã¿åéãããããªã¨ã³ã¸ãã¢ããããã¨ããã·ã¼ã³ã«ãã㦠ã¯ã¨ãªã®çµæã®åå©ç¨æ§ãä½ã ããã使ããã¼ã¹ã¯ã¨ãªã¯é¢æ°åãã¦ãã¿ããªã§ä½¿ãåããã¨ãããã¨ãã§ããªãã
åèè³æ mysqlãsqliteã«ã¤ãã¦ã¯stackoverflowã®ä¸è¨è¨äºåç § http://stackoverflow.com/questions/10065051/python-pandas-and-databases-like-mysql å°ãä¸è¨ã§ä½¿ã£ã¦ããframe_queryã¯deprecatedã«ãªã£ã¦ãã¦ãç¾å¨ã§ã¯read_queryã使ããããã postgresqlã¨ã®æ¥ç¶ psycopg2ã使ã pip install psycopg2 SELECTããéã®é©å½ãªãµã³ãã«ã³ã¼ã import psycopg2 as pg with pg.connect(database='db_name', user='user_name', host='host_name', port=5432) as conn, conn.cursor() as cur: cur.exec
"""Get data from MySQL with pandas library.""" import MySQLdb import pandas.io.sql as psql con = MySQLdb.connect(db='work', user='root', passwd='') # DBæ¥ç¶ sql = """SELECT product_id, product_nm, product_features FROM electronics""" df = psql.read_sql(sql, con) # pandasã®DataFrameã®å½¢ã§ãã¼ã¿ãåãåºã con.close()
pandas.DataFrameã®è¡åï¼index, ã¤ã³ããã¯ã¹ï¼ã»ååï¼columnsï¼ãå¤æ´ããã«ã¯ãrename()ã¡ã½ãããset_axis()ã¡ã½ãããªã©ã使ãã æ¢åã®åãã¤ã³ããã¯ã¹ã«è¨å®ããset_index()ã¨ããã¡ã½ãããããã é¢é£è¨äº: pandas.DataFrameã®åãã¤ã³ããã¯ã¹ï¼è¡åï¼ã«å²ãå½ã¦ãset_index æ¬è¨äºã®ãµã³ãã«ã³ã¼ãã®pandasã®ãã¼ã¸ã§ã³ã¯ä»¥ä¸ã®éãããã¼ã¸ã§ã³ã«ãã£ã¦ä»æ§ãç°ãªãå¯è½æ§ãããã®ã§æ³¨æã以ä¸ã®pandas.DataFrameãä¾ã¨ãã¦ä½¿ãã import pandas as pd print(pd.__version__) # 2.0.3 df = pd.DataFrame({'A': [11, 21, 31], 'B': [12, 22, 32], 'C': [13, 23, 33]}, index=['ON
excl ã©ã¤ãã©ãª ãªããããªãã®æ¸ããã®ã Goè¨èªã«ã¯Excelä½æç¨ã®ã©ã¤ãã©ãª xlsx ããã§ã«åå¨ãã¾ãã xlsxã©ã¤ãã©ãªã¯å¼·åã§ãæ®éã«ä½¿ç¨ããå ´åãã®ã©ã¤ãã©ãªãä¸çªã ã¨æãã¾ãã ãã ãxlsxã©ã¤ãã©ãªã調æ»ãã¦ããã¨ä»åä½æãããã®ã®ä»æ§ã«èããããªãé¨åãããã¾ããã xlsxã©ã¤ãã©ãªã®å©ç¹æ¬ ç¹ xlsxã©ã¤ãã©ãªã«ã§ããã㨠ã»Excelãã¡ã¤ã«ã®æ¸ãè¾¼ã¿ã»èªã¿è¾¼ã¿ã»æ°è¦ä½æ ã»ã»ã«ã®æ¸å¼è¨å® ã»Excelãã¡ã¤ã«ã解åããã«æ±ãã ã»OpenXMLã®ä»æ§ã«åºã¥ããéçº xlsxã©ã¤ãã©ãªã®åé¡ ã»æ¢åã®Excelãã¡ã¤ã«ã使ç¨ããã¨ãããããªãã®ãæ¶ãã ã»ãã£ã¼ããæ¶ãã ã»ç»åãæ¶ãã ã»å³å½¢ãæ¶ãã ã»ãã¯ãã®åå¨ãããã¡ã¤ã«ã®å ´åã¯ãã¯ããæ¶ãã ã»ã¡ã¢ãªä½¿ç¨éãç°å¸¸ã«é«ããªã ã»æ°åã¡ã¬ãã¤ãã®ãã¼ã¿ã§ã使ç¨ã¡ã¢ãªãã®ã¬ãè¶ ãã exclã©ã¤ã
ã¯ããã« stackoverflowãæ¯å¹´è¡ã£ã¦ããéçºè åãã¢ã³ã±ã¼ãã®2015å¹´ã®çµæã§å¥½ããªè¨èª(ãã1年使ã£ã¦ãã¦ãä»å¾ã使ãç¶ãããè¨èª)ã§3ä½ã«ãªã£ãRustã«ã¤ãã¦ååãããããç¥ããªãã£ãã®ã§å ¥éãã¦ã¿ã¾ããã è¿½è¨ æåã¯betaæç¹ã®æ å ±ã§ããããStableçãªãªã¼ã¹ã«ä¼´ã£ã¦è¨äºæ´æ°ãã¾ããã ã¨ãã£ã¦ãåä½ç¢ºèªãç´ãããããã§ãã ãã¨ãæåã«æ¸ãã¦ãstackoverflowã®ã¢ã³ã±ã¼ãçµæç´¹ä»ã¯ãã£ã±ãéªéã ã£ãã®ã§æ¶ãã¾ããï½ ç§ã®ã©ãã§ããã ã³ã¡ã³ãã¯æ´æ°å±¥æ´ããåç §ãã¦ããããã°ã¨æãã¾ãã Rustã¨ã¯ ã¨ããããç®æ¡æ¸ãã§ã (ãªãrustã¯å§ããã°ãããªã®ã§èªåã®ç解ãããããç¹ãããããããã¾ãããããããªç¹ã«æ°ã¥ããæ¹ã¯ ããµã«ãª ãææé ãããã¨æãã¾ãã) èæ¯ã¨ãã¤ã«ã¹ãã¼ã³ 2009å¹´ã«Graydon Hoareã«ãã£ã¦éçºããããã®ã§
è¡rowã追å ãããè¡ã®è¿½å ã ãããããã¼ã¿ãã¬ã¼ã DataFrameããã£ãæã In [71]: df Out[71]: id name birthday is_relative 0 1 Hage 1960-01-01 1 1 2 Hige 1960-01-02 1 ï¼è¡è¿½å ãããæã¯ãã·ãªã¼ãºSeriesã§ãã¼ã¿ä½ã£ã¦ã.append()ããã°ããã£ã½ãã ãã£ã¦ã¿ãã In [74]: se = pd.Series([3, 'Hoge', date(1960,1,3), 1], index=df.columns) In [75]: se Out[75]: id 3 name Hoge birthday 1960-01-03 is_relative 1 dtype: object In [76]: df.append(se, ignore_index=True) Out[76]:
ã¯ããã« æã¯vimã®ãã©ã°ã¤ã³ããã使ç¨ãã¦ãã¾ããã ãããããã©ã°ã¤ã³ãå ¥ãããã³ã«ãã®ãã©ã°ã¤ã³ã®ã³ãã³ããè¦ããå¿ è¦ãããããã®ä½æ¥ã段ã é¢åã«ãªã£ã¦ãã¾ããã ãã©ã°ã¤ã³ããªãã¨ã§ããªããã¨ã¯å½ç¶ããã¾ãããããããã©ã°ã¤ã³ã使ããªãç°å¢ã§ä½æ¥ããããã¨ãããã®ã§ãæè¿ã¯ãã©ã°ã¤ã³ã«é ¼ããããVimèªä½ã®æ©è½ããã£ã¨ç¥ããã¨ã«æ³¨åãã¦ãã¾ãã ãã®çµæãããã©ã«ãã®æ©è½ã§è²ã ã§ãããã¨ãåãã£ã¦ãã¾ããã å ±æã®æå³ãè¾¼ãã¦ä¾¿å©ãããªæ©è½ãå°ããã¤è¨äºã«ãã¦ãããã¨æãã¾ãã èµ·åãªãã·ã§ã³
ãªããã¼ãã¼ããã¦ãããã¡ã«ã²ãã³ãã® pandas ã¨ã³ããªã«ãªã£ã¦ãã¾ã£ããåºæ¬çãªä½¿ãæ¹ã«ã¤ãã¦ã¯ç¶²ç¾ ãããæ°æã¡ã¯ããã®ã§ãããã ä»å㯠ãã¼ã¿ã®é£çµ / çµåã¾ããããã®é¨å å ¬å¼ããã¥ã¡ã³ã ãã¡ãã£ã¨ãããã«ããã®ã§æ¹è¨ããããªã¨æã£ã¦ãã¦ãèªåã®æ´çãããã¦æ¸ãããã å ¬å¼ã®æ¹ã¯ããå°ãç´°ãã使ãæ¹ãè¼ã£ã¦ããã®ã ããç¹ã«éè¦ã ããã¨ããã¨ããã ããã¾ã¨ããã é£çµ / çµåã¨ããç¨èªã¯ä»¥ä¸ã®æå³ã§ä½¿ã£ã¦ãããã¾ãæ¶ãã¦ãããã»ããããé¢æ°ãã¡ã½ããã¯ä»¥ä¸ã® 4 ã¤ã ãã é£çµ: ãã¼ã¿ã®ä¸èº«ãããæ¹åã«ãã®ã¾ã¾ã¤ãªãããpd.concat, DataFrame.append çµå: ãã¼ã¿ã®ä¸èº«ãä½ãã®ãã¼ã®å¤ã§ç´ä»ãã¦ã¤ãªãããpd.merge, DataFrame.join é£çµ (concatenate) æè»ãªé£çµ pd.concat ãµãã¤ã® DataFram
import pandas as pd df = pd.read_csv('sample.csv') df Date Serial_No Var1 Var2 Var3 0 2016-04-01 1 0.708636 0.014882 0.765210 1 2016-04-02 1 0.211528 0.012070 0.071375 2 2016-04-03 1 0.745620 0.211446 0.593242 3 2016-04-04 1 0.378551 0.249341 0.899383 4 2016-04-05 1 0.692113 0.800209 0.573121 5 2016-04-01 2 0.942247 0.047866 0.476508 6 2016-04-02 2 0.440591 0.098763 0.998441 7 2016-04-03 2 0.33940
ãä»äºä¸ã®éçºãå ¨ã¦Linuxã§ãiTermã®ã¦ã£ã³ãã¦åãæ¿ãã«æ £ãã¦ã身ã¨ãã¦ã¯è³æ¥µè¦çã ã£ãã®ã§tmuxãæ¬æ ¼çã«ä½¿ãå§ããã ããã¨åããã¦ä»ã¾ã§ææ§ã«ãã¦ãdotfilesãæ´çããéãtmuxãèµ·åããç¶æ ã§ã®vimãããããã£ãã®ã§ç´ããã ç´ãå ãããªæãã æ¬å½ã¯ãããªãã¯ã 解決ç tmuxã256è²è¡¨ç¤ºãã§ãã¦ãªãã®ãåå ã ãªã®ã§~/.tmux.confã«ä»¥ä¸ã®ï¼è¡ã追è¨ããã set-option -g default-terminal screen-256color set -g terminal-overrides 'xterm:colors=256' ä¸ã®ï¼è¡ã¯ggãã¨çµæ§ç»å ´ããã®ã ããä»åã¯ä¸ã®ï¼è¡ã足ããªããã¨ã§ã¤ã¾ã¥ãã¦ããã ã¡ãªã¿ã«tmuxãèµ·åããéã-2ãªãã·ã§ã³ãã¤ãããã¨ã§ã256è²è¡¨ç¤ºãå®ç¾ã§ãããã¡ãã¨vimã§ã表示ãããã¨ãã§ãã
ãã¾ã«ã¤ã³ã¿ã¼ãããã¨çéããªããã·ã³ããããã¤ããªãããããªããã¨ãããã¨æãã ä»åã¯ããããªæã«ã©ããã£ã¦ Python ã®ããã±ã¼ã¸ã対象ãã¹ãã«ã¤ã³ã¹ãã¼ã«ããã°ãããã«ã¤ãã¦æ¸ãã è¦ç´ãå ã«æ¸ãã¦ããã¨ãã¾ã OS ã®ããã±ã¼ã¸ã·ã¹ãã ã使ã£ã¦ Python ã®ããã±ã¼ã¸ããã¼ã¸ã£ pip ãã¤ã³ã¹ãã¼ã«ããä¸ã§ãWheel ã¨ãã Python ã®ããã±ã¼ã¸ã³ã°å½¢å¼ã§ãã«ããããã®ã使ã£ã¦ã¤ã³ã¹ãã¼ã«ããã°ããã æ¤è¨¼ã®ç°å¢ã«ã¯ CentOS7 ã使ã£ãã $ cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) $ uname -r 3.10.0-229.11.1.el7.x86_64 Python ã®ããã±ã¼ã¸ããã¼ã¸ã£ pip ãã¤ã³ã¹ãã¼ã«ãã ã¾ã㯠Wheel å½¢å¼ã® Python ããã±ã¼ã¸ã
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? extern crate futures; extern crate hyper; extern crate tokio_core; use std::io::{ self, Write }; use std::time::{ Duration, SystemTime }; use futures::{ Future }; use futures::future::{ join_all }; use hyper::Client; use hyper::client::{ HttpConnector }; use tokio_core::
extern crate hyper; use std::io::prelude::*; use std::io::stderr; use std::sync::Arc; use std::thread; use std::time::{ Duration, SystemTime }; use hyper::Client; fn to_seconds(duration: &Duration) -> f64 { let nanos = duration.subsec_nanos() as u64; let secs = duration.as_secs(); ((1000_000_000 * secs + nanos) as f64) / 1000_000_000. } fn do_http_request(client: Arc<Client>, index: usize, url: &s
æ¦è¦ â»ãã®è¨äºã¯RuboCop v0.28.0ã対象ã§ãã https://github.com/bbatsov/rubocop/tree/v0.28.0 Assignment Branch Condition size for method_name is too high. [15.33/15] RuboCopã使ã£ã¦ãã¦ããããªè¦åãåºã¦å°ã£ãã®ã§èª¿ã¹ãçµæãã¾ã¨ãã¾ããã ããã¯ABC Sizeã¨ãããã§ãã¯é ç®ã§ãããã¤ã¾ã㨠Assignment : å¤æ°ã¸ã®ä»£å ¥ Branch : ã¡ã½ããå¼ã³åºã Condition : æ¡ä»¶æ ä¸è¨3é ç®ã®åè¨ãã¤ã³ããRuboCopåãè¨ç®ãã¦ãåºæºå¤ãè¶ ããã¨è¦åãåºããã¨ããä»çµã¿ã RuboCopãRubyç¹æã®ãã§ãã¯ã§ã¯ãªããAbc Metricã¨ãã£ã¦æãããããã®ãããã ã¡ãªã¿ã«ãããããã®é æåãã¨ã£ã¦ABCã¨ã®ãã¨ã
package main import ( "fmt" ole "github.com/go-ole/go-ole" "github.com/tanaton/go-ole-msoffice/excel" "path/filepath" "strings" ) type ExcelGraph struct { app *excel.Application } type GraphItem struct { x int count int rg *excel.Range leg []string } func main() { // COMã®åæå ole.CoInitializeEx(0, ole.COINIT_APARTMENTTHREADED|ole.COINIT_DISABLE_OLE1DDE) // 確å®ã«è¡ãå¿ è¦ããããã defer ole.CoUninitialize() //
2015-02-22ãªãã¦ã§ãã¢ããªéçºããã¦ããã¨Internet Explorerã§ã®åä½ç¢ºèªã®ããmodern.IEãæ¬ ããã¾ãããããã¤ã³ã¹ãã¼ã«ç´å¾ã¯è±èªç°å¢ã«ãªã£ã¦ããã®ã§ãæ¥æ¬èªç°å¢ã§ã®åä½ç¢ºèªã®ããã«ã¯ã»ããã¢ãããå¿ è¦ã§ãã ã»ããã¢ããæé ã¯ä»¥ä¸ã®Qiitaã®è¨äºã«æ¸ããã®ã§ãããææ°ãå¤ãã¦é¢åã§ããã VirtualBox - modern.IEã®Windows 7ã§æ¥æ¬èªã®è¡¨ç¤ºã¨å ¥åãã§ããããã«ãã - QiitaWindows8.xã®modern.IEã§æ¥æ¬èªãå ¥åã表示ã§ããããã«ããã - Qiitaãããèªååããã³ãã³ãã©ã¤ã³ãã¼ã«moderniejapanizerãä½ãã¾ãããå®ã¯2å¹´ãããåã«AutoItã使ã£ã¦ä½ãå§ããã®ã§ããèªåå¶å¾¡ããã¾ããããªãã¨ãããã£ã¦æ«æãã¦ãã¾ãããæ¨å¹´æ®ããããããåææ¦ãã¦ãä»åã¯åå¼·ãå ¼ãã¦Goã§å®è£ ãã¦ã¿ã¾
template_methodãã¿ã¼ã³ã§ã http://www.techscore.com/tech/DesignPattern/TemplateMethod.html#dp3-3 ã¢ã«ã´ãªãºã é¨åãåå¥ã®é¨åã¨ãã¦æ½è±¡åã㦠é¨åã®çµã¿ç«ã¦ã ããã¹ã¼ãã¼ã¯ã©ã¹ã¨ãã¦å®è£ ããã ãªããçµæ§ä½¿ããå ´é¢ãããããã§ããã class Wood attr_accessor(:draw_param, :cut_param) end class WoodCutPrint def draw(hanzai); end def cut(hanzai); end def print(hanzai); end def create_wood_cut_print hanzai = Wood.new draw(hanzai) cut(hanzai) print(hanzai) end end class Tan
ãã®è¨äºã¯Ruby Advent Calendar 2014ã®13æ¥ç®ã®è¨äºã§ãã åãã« Rubyãæè²ã»ç 究ã«ä½¿ããã¨ãã試ã¿ã¯Rubyã®é»ææããããã¾ããã ãã®ææã®æåãªããã±ã¼ã¸ã¨ãã¦ã¯ãã¤ãªã¤ã³ãã©ããã£ã¯ã¹ã®BioRubyãå°çç§å¦ã®é»è³Rubyããã¸ã§ã¯ããæåã§ãã å è¿°ã®BioRubyãGPhys(é»è³Rubyã®ææç©)ã¯ç¾å¨ãæ´æ°ãç¶ãããã¦ãããå¤æ°ã®å©ç¨è ãæ±ãã¦ãã¾ãã ãããå ¨ä½ã¨ãã¦è¦ãå ´åãç§å¦ã®åéã§ä½¿ãããLLè¨èªã¨ãã¦Rubyã¯PythonãRã®å¾å¡µãæãã¦ããå°è±¡ãããã¾ãã ç§å¦è¨ç®ã«ãããå質åããããã¯ãªãPythonãçå®ã«ä»è¨èªã®ã·ã§ã¢ã奪ã£ã¦ããã è¨äºã®ããã«ãã®åéã§ã¯Pythonã³ãã¥ããã£ãé常ã«æ´»çºã§ãæ©æ¢°å¦ç¿ãªã©æ°ããæè¡ã¯çã£å ã«Pythonã§å®è£ ãããããã«ãªã£ã¦ãã¾ãã ãããæè¿Rubyã§ãå°ããã¤ã§ããç°å¢ãå
ãã¼ã¿è§£æã¨ããã°PythonãRã使ããã¨ãå¤ãããRubyã§ãç°¡åãªãã¼ã¿è§£æã¯è¡ããã¨ãã§ããã Rubyã§ãã¼ã¿ãã¬ã¼ã ï¼Excelã®ã¹ãã¬ããã·ã¼ãã®ãããªãã¼ã¿æ§é ï¼ãæ±ãã«ã¯ãDaru ã¨ããã©ã¤ãã©ãªãå©ç¨ã§ãããä½è ã®@v0droããã¯Rubykaigi 2016ã§ãç»å£ãã¦Daruã«ã¤ãã¦çºè¡¨ãã¦ãã¦ãå ¬æ¼ã®æ§åã¯ãã¡ãã§è¦ããã¨ãã§ããã ãã®è¨äºã§ã¯ãDaruã®åºæ¬çãªä½¿ãæ¹ãç´¹ä»ããã å¿ è¦ãªæ©è½ãå ¨é¨æ¸ãã¨éãå¤ããªãã®ã§ãæå°éã®å©ç¨ä¾ã®ã¿æ¸ãã¦ããã ç°å¢ Ruby2.3.1 daru 0.1.4.1 Gemfileã« gem "daru" ã¨æ¸ãã¦bundleããã°OKã 以å¾ãrequire "daru" ãè¡ã£ã¦ããå®è¡ãã ãã¼ã¿æ§é dataframeã¯ï¼æ¬¡å é åã®ãããªæ§é ã§ãDaru::DataFrame ã¨ããååã®ã¯ã©ã¹ã«ãªãã dataf
èæ¯ å æ¥ãRubyKaigi 2015 ã«åå ãã¦ãã¾ãã çµäºå¾ãâã®ãããªææ³ã¨ã³ããªãèªãã§ãããã ããªã¼ã¨æãã¾ãã RubyKaigi 2015(3æ¥ç®) ãã ã®ã«ã£ã ã¨ããã§ä»åã®RubyKaigiã§ãããããã¯ã¾ãããªãã¨æã£ããã¨ã«ãæ©æ¢°å¦ç¿ç³»ã®çºè¡¨ãã²ã¨ã¤ããªãã£ããç¹ããããæ¨æ¥ã®ãã¼ãã£ã§ã話é¡ã«ããã¦ã¿ãã¨ãããå±æ©æãæ±ãã¦ãã人ã¯å°ãªãããããå°è±¡ã ãã©ãæ ¹ã£ãããã©ãã¨æ°å¤æ¼ç®ã©ã¤ãã©ãªã®æ´åããã¼ã£ã¨æ¾ç½®ãã¦ãããã¨ãããã ãããæ°ãã¤ãã¨æ°å¤æ¼ç®æ¹é¢ã§ã¯Pythonã«å¤§ããæ°´ãããããã¦ãã¦ããã¾ããã®å¿ç¨ã§ããæ©æ¢°å¦ç¿ã§ã¯(LLã®ä¸ã§ã¯)Pythonã®ç¬å£å ´ã ãWebã¢ããªã±ã¼ã·ã§ã³ã®åéã§ä¸ä¸ã風é¡ããæ°ã«ãªã£ã¦ãéã«ããã¾ä¸çªããããªé åãã¾ã£ãã話é¡ã«ãªããªãè¨èªã«ãªã£ã¦ãã¾ã£ãã ã¨ããããã§ãRuby ã§ãã¼ã¿ã»ãããå¼ã Gem ã£ã¦ã®ã
RubyKaigiã«åå ããã¨ã³ã¼ãæ¸ãããã¨ããæ°æã¡ãé«ã¾ã£ã¦è¯ãã®ã§ãããä»åã¯PDFã®è¡¨ãèªã¿è¾¼ã㧠pandas ã® DataFrame ã«å¤æã§ãã tabula-pyãä½ãã¾ããã ããããã£ã¦RubyKaigiã®åå å ±åã¨ããã¦ããã ããã°ã¨æãã¾ãã tabula-pyã¨ã¯ tabula ã¨ããJavaã§æ¸ãããPDFãã表ãæ½åºããã©ã¤ãã©ãªãPythonã§ããã¼ãã©ãããããã®ã§ããå®è£ ãè¦ã¦ãããã°ãããã¨æãã¾ãããæ¬å½ã«subprocessã§Javaã®ããã°ã©ã ãå©ãã¦æ¨æºåºåã§åãåãã¨ããã ããããã£ã¦ãã¾ããã ãã¨ãã¨ã¯ãRã®tabulaå®è£ ãããªãè²ã ã§ããã®ãç¥ã£ã¦Pythonããªããããã¨ããã®ã§ä½ãã¾ãããRã®å®è£ ã¯ãã¸ã§Javaãããããæ¸ãã¦ãã¦å°æ¬ã®å¿µãæ±ãã¦ãã¾ãã tabulizerããã±ã¼ã¸ã«ããPDF表ãã¼ã¿ããã®ãã¼ã¿åå¾ git
ãã¼ã¿ãæ±ãä»äºããã¦ããã¨ãä½ããã®å½¢ã§ãã¼ã¿ãããé åºã«æ²¿ã£ã¦å¦çãã Workflow = ãã¼ã¿ãã¤ãã©ã¤ã³ãæ§ç¯ããå¿ è¦ã«ãªãå ´é¢ã«åºããããã¨ãå¤ãã¨æãã¾ãã ããããå¦çã«é©ç¨ã§ããã½ããã¦ã§ã¢ã¯æ¢ã«ããã¤ãåå¨ããã®ã§ãããèªåãä»äºã§ä½¿ãä¸ã§ããããããã®ããªãã£ãã®ã§ãtumugi ã Ruby ã®ã©ã¤ãã©ãªãä½æãã gem ã¨ãã¦å ¬éãã¾ããããã´ã¯ãããªæãã Workflow Engine ãã¤ãããï¼ ã·ãªã¼ãºé£è¼ã¯ãå ã ãã®ã©ã¤ãã©ãªã®è¨è¨ãæ´çããããã«æ¸ãã¦ããè¨äºã§ãããã¾ã ãæªå®ã§ããèå³ã®ããæ¹ã¯ãã¡ãããèªã¿ãã ããã 注é ãã®è¨äºã¯ tumugi ã Python ã§æ¸ãããã¯ã¼ã¯ããã¼ã¨ã³ã¸ã³ã§ãã Luigi ã«å¼·ãå½±é¿ããã¦æ¸ãããã¨ããã対æ¯ã¨ãã¦åããããããã Building Data Pilelines with Pytho
ä»äºã§ BigQuery ã®ã¯ã¨ãªã®çµæãå ±æç¨ã®ãã©ã«ãã« Google Sheets å½¢å¼ã§ä¿åãã¦ãSlack 㧠URL ãå ±æãããã¨ãããã¨ãé »ç¹ã«ãã£ã¦ããã®ã§ããã WebUI ã ã¨ãã¯ã¨ãªçµæã Google Sheets å½¢å¼ã§ä¿åã§ãããã©ããã¡ã¤ã«åã¨ãã©ã«ããæå®ã§ããªãã®ã§ããã¡ãã¡ååãå¤ãã¦ããã©ã«ãã移åããªãã¨ãããªããSlack éç¥ã¯ã§ããªãã Google Apps Scirpt (GAS) ã ã¨ãå ¨é¨å®ç¾ã§ãããã©ãã³ã¼ãã®ç®¡çã GitHub ã§ããã®ãé¢å ã¨å®å½¢å¦çãªã®ã«ãã¤ãã¤ãå¹çã®è¯ãæ¹æ³ããªãã£ãã®ããtumugi 㧠Ruby ã¹ã¯ãªããåãã¾ããã tumugi ã«ã¤ãã¦è©³ç´°ã«ç¥ãããæ¹ã¯ãRuby 㨠tumugi ã«ãããã¼ã¿ãã¤ãã©ã¤ã³æ§ç¯ ãã覧ãã ããã ã¿ã¹ã¯ãåå²ãã¦ãå®ç¾©ãã ãBigQuery ã®ã¯ã¨ãªçµæã
ã¯ããã« ãã®è¨äºã¯ Windows 㧠Rust ã使ã£ã¦ããã°ã©ãã³ã°ãããã Rust ã®ãããã°å®è¡ãåºæ¥ãéçºç°å¢ãæ´ããã ã¨ãã人ã対象ã«ãããå¿å´é²çãªè¨äºã§ã(ã»âã»)ã éçºç°å¢ã«ã¯ Visual Studio Code ã使ç¨ãã¾ã(ã»âã»)ã Rust èªä½ãå²ãã¨ããã¢ãã¯ãªããã°ã©ãã³ã°è¨èªãªãããWindows åãã®æ å ±ããããä¸ã«å°ãªããããªã®ã§æ¸ãã¦ããã°èª°ãã®å½¹ã«ç«ã¤ãããããªãã¨æã£ã¦æ¸ãã¦ããã¾ã(ã»âã»)ã éçºç°å¢æ§ç¯ã«å¿ è¦ãªãã® Windows 10 Pro x64 rustup-initï¼ããï¼ GDB 7.9.1 x64ï¼ããï¼ Visual Studio Codeï¼ããï¼ ãã¶ã Windows 7 以éãªãåé¡ãªãã¨æãã¾ãããæ¤è¨¼ãã¦ãã¾ãã(ã»âã»)ã ã¾ãã32ãããçã¯æ¤è¨¼ãã¦ãã¾ãã(ã»âã»)ã æé å ¨ä½ã®æé rustu
ãªã«ãã¦ããã 社ä¼äººçæ´»4å¹´ç®ã§ãWindows ã«æã¾ããã£ã¦ãã¾ãã¾ãã・・・ ShellScript 㧠GCC ãã«ãããã¦ãããã®é ã«ã¯ãã・・・ ã㦠Rust ããã®ãã触ã£ã¦ã¾ãã ã§ãWindows ã§ã API ãã¡ããã£ã¨ãã£ãã®ã§ã試ãã«ãã£ã¦ã¿ã¾ããã ROki1988/active_window_logger ã§ãåçã« ãã¼ ã¨æã£ãã®ãããã®é¨åã let mut title = vec![ 0u16; (length + 1) as usize ]; unsafe { user32::GetWindowTextW(whdl, title.as_mut_ptr(), length + 1); } unsafe ä½ã¦ãããã malloc/free ãªã®ããªã¼ãªãã¦æã£ã¦ããã§ãããããã£ã¨ç¢ºä¿åºæ¥ã¾ããã è¨ããã¦ã¿ãã°ããããã«ãªã¼ãé åºãã£ãã mut
æ¥ã http://manga-now.com 㧠xml ããã¼ã¹ãã¦ããã®ã ãã©ãPython ã®å®è£ ã Go ã«å¤ãããéããªãã®ãæ¯è¼ãã¦ã¿ã¾ããããªããã¼ã¹ã®é度ã ãæ¯è¼ãããã®ã§ xml ãã¡ã¢ãªã«èªã¿è¾¼ã¾ããç¶æ ããåè¦ç´ ãåå¾ãçµããã¾ã§ã®é度ãè¨æ¸¬ãã¦ãã¾ãã xml ã®ãã¦ã³ãã¼ã ã¾ã Amazon Product Advertising API ã使ã£ã¦æ¸ç±æ å ±ã® xml ãè½ã¨ãã¦ãã¡ã¤ã«ã«ä¿åãã¦ããã¾ãã get_books_xml.go # -*- coding:utf-8 -*- import time from lxml import objectify class ImageInfo: def __init__(self): self.url = '' self.width = '' self.height = '' class BookInfo: d
$ mypy test.py test.py: note: In function "func": test.py:2: error: Incompatible return value type (got "str", expected "int") ã¢ããã¼ã·ã§ã³ãå ã«åããã§ãã¯ãã¦ãæ»ãå¤ã®åãintãªã®ã«strãè¿ãã¦ããã®ã§ã¨ã©ã¼ã«ãªãã¾ãã ãã£ã¦ããæ°æã¡ "mypyãã£ã¦ãã"ã¨ããã®ã¯ãPEP 484ã«å¯¾å¿ããåã¢ããã¼ã·ã§ã³ãä»ããmypyãå®è¡ãéçãã§ãã¯ããã¹ãããã¨ãæãã¾ãããªããã£ã¦ããæ°æã¡ã«ãªã£ããã¨ããã¨ãStatic types in Python, oh my(py)! ãã®è¨äºãèªãã ãã¨ã大ããã§ãããã£ã¦ãããããªæ°ããã¾ãããæ å½ãã¦ããæ¡ä»¶ãè¦æ¨¡ã大ããæ¢åæ©è½ã®å¤æ´é »åº¦ãé«ããã®ã ã£ãã®ã§ãä¿¡é ¼ã§ããåã¢ããã¼ã·ã§ã³ãæãã¨ãä¿®æ£ãã
æ¬ç¨¿ã¯ 2016å¹´10æ13æ¥ (æ¨) ã« Tim Abbott æ°ã«ãã£ã¦æ¸ãããè¨äºã®ç¿»è¨³ã§ãã Static types in Python, oh my(py)! https://news.ycombinator.com/item?id=12703008 å 責äºé /Disclaimer æ¬ç¨¿ã¯ éå ¬å¼ ã®ç¿»è¨³è¨äºã§ã (èè ã® Tim Abbott æ°ã«ç¿»è¨³ãå ¬éãããã¨ã®ç¢ºèªã¯åã£ã¦ãã¾ã) ãæ¬ç¨¿ã®å 容ã«é¢ã㦠Tim Abbott æ°ã¨ Dropbox 社ã¯ä¸åã®è²¬ä»»ãè² ãã¾ããã 誤訳ãªã©ããã¾ãããç§å®ã«ç·¨éãªã¯ã¨ã¹ããéã£ã¦é ããã¨å©ããã¾ãã è¬è¾ @takada-at ã«èª¤è¨³ã®ææãã³ã¡ã³ãã§é ãã¾ãã @shimizukawa ãã誤訳修æ£ã®ç·¨éãªã¯ã¨ã¹ããé ãã¾ãã @cocoatomo ã¯å ¨ä½ãéãã¦èª¤è¨³ä¿®æ£ãããåããããæ¥æ¬èªã®è¡¨ç¾ã«ãã¦ããã¾ãã ç§ã®æ
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? æ¬ç¨¿ã¯ Python ã«åã¢ããã¼ã·ã§ã³ã追å ããã¨ããææ¡ãè¡ãããã¨ãã«èµ·ãã£ã Python ã³ãã¥ããã£ã®è°è«ã®å¾ã2014å¹´8æ24æ¥ (æ¥) ã« Armin Ronacher (@mitsuhiko) æ°ã«ãã£ã¦æ¸ãããè¨äºã®ç¿»è¨³ã§ãã Revenge of the Types Revenge of the Types by Armin Ronacher : Python (REDDIT) Revenge of the Types | Hacker News Python 3.5 ã§å°å ¥ãæ¤è¨ãã¦ããåã¢ããã¼ã·ã§ã³ã«ã¤ãã¦
Python3.6.0 ã2016å¹´12æ23æ¥ã«ãªãªã¼ã¹ãããæ°ãã«ã¢ãããã¼ããããé ç®ãããã¤ãããã¾ãã Whatâs New In Python 3.6 ãã¯ãPythonã使ã£ã¦ããã°ã©ãã³ã°ããã人ã«ã¨ã£ã¦ã¯ãæ°ãã«è¿½å ãããææ³æ©è½ãªã©ãç¹ã«æ°ã«ãªãã®ã§ã¯ãªãã§ããããï¼ ããã§ä»åã¯3.6.0ã§è¿½å ãããææ³æ©è½ã§ããã PEP 498: æ¸å¼åæ¸ã¿æååãªãã©ã« PEP 515: æ°å¤ãªãã©ã«å ã®ã¢ã³ãã¼ã¹ã³ã¢ PEP 526: å¤æ°ã¢ããã¼ã·ã§ã³ã®ã·ã³ã¿ãã¯ã¹ PEP 525: éåæã¸ã§ãã¬ã¼ã¿ PEP 530: éåæå å è¡¨è¨ ã«ã¤ãã¦ç´¹ä»ãã¾ãã æ¸å¼åæ¸ã¿æååãªãã©ã«(f-strings) Pythonã«ã¯ãæåå(string)ã¯ã©ã¹ã«format()ã¡ã½ãããç¨æããã¦ãããstr.format()ãç¨ãã¦å¤æ°ç½®æãå¤ã®ãã©ã¼ããããè¡ããã¨ãã§ãã¾ãã
æ¬ç¨¿ã¯ Python ã«åã¢ããã¼ã·ã§ã³ã追å ããã¨ãã PEP 483 - The Theory of Type Hinting ã®ææ¡ã§åç §ããã¦ãã Jeremy Siek (@jeremysiek) æ°ã¨ Walid Taha æ°ãéçºãã漸é²çåä»ãã«ã¤ãã¦ã®å ¥éè¨äºã®ç¿»è¨³ã§ãã What is Gradual Typing Python 3.5 ã§å°å ¥ãããåã¢ããã¼ã·ã§ã³ã«ã¤ãã¦èå³ãããæ¹ã¯ä»¥ä¸ãåèã«ãã¦ãã ããã Python ã¨åãã³ã (Type Hints) 㨠#pyconjp [翻訳] PEP 0484 -- åãã³ã (Type Hints) Revenge of the Types: åã®å¾©è® ç§èªèº«ãåã·ã¹ãã ã«æãããªããããä¸é¨æªè¨³ã®é¨åããã£ãããåéãã誤訳ãããã¨æãã¾ãããããã£ã誤ããè¦ã¤ãããç·¨éãªã¯ã¨ã¹ããéã£ã¦ããããã¨å©ããã¾ãã
Clojureããã°ã©ã ãé«éåããããã®ãã¯ããã¯éã§ãã æ¬ç¨¿ã«æ¸ãã¦ããææ³ãå ¨ã¦ã§ã¯ããã¾ãããåã ã®ææ³ã«ã¤ãã¦ç´°ããæ¸ãã¦ã¯ããªãããã詳ããæ å ±ã¯ä»ã®æç®ãåç §ãã¦ãã ãããã¾ããClojureããã°ã©ã ã®å¤å´ï¼JVMãªã©ï¼ã«ã¤ãã¦ã¯è¨è¿°ãã¦ãã¾ããã Premature optimization is the root of all evil. -- Donald Knuth é度ãªãã¥ã¼ãã³ã°ã¯ä¿å®æ§ãå¯èªæ§ãç ç²ã«ããå ´åãããã®ã§ã注æãå¿ è¦ã§ãã Measure. Don't tune for speed until you've measured, and even then don't unless one part of the code overwhelms the rest. -- Rob Pike ããã«ããã¯ããã¡ãã¨èª¿æ»ããä¸ã§ãé©åãªããã©ã¼ãã³ã¹
ããã°ã©ãã³ã° Clojure ã®ç¬¬ï¼çãåºçããã¾ããã amazon ã§ä¸æçã«å¨åº«åãã«ãªã£ã¦ããã¨æã£ã¦ãããã人æ°ããã(ã§ã¦ããï¼) Clojureã ãã㪠Clojure ããããã使ãå§ãã人ã®ãããèªåã使ã£ã¦ããã©ã¤ãã©ãªããªã¹ãã¢ãããã¦ããã¾ãã Web ã¢ããªã±ã¼ã·ã§ã³/ãã¬ã¼ã ã¯ã¼ã¯ Ring WSGI(Python)ãRack(Ruby) ã® Clojure çã Compojure Ring ããã¼ã¹ã«ãã軽é Web ãã¬ã¼ã ã¯ã¼ã¯ã Sinatra(Ruby) ã® Clojure çã Ring ã¨ä½è ãåãã lib-noir Ring ãã¼ã¹ã®ã¢ããªã±ã¼ã·ã§ã³ã§ä½¿ããã¦ã¼ãã£ãªãã£ã©ã¤ãã©ãªã Noir ã£ã¦ãã Compojure ãå é¨çã«å©ç¨ãã¦ãããã¬ã¼ã ã¯ã¼ã¯(éçºçµäº)ãã便å©ãªæ©è½(ã»ãã·ã§ã³ãããªãã¼ã·ã§ã³ç)ãåãåºããã©ã¤ãã©ãª
Clojure 楽ããã§ãããä»å¹´ã® 8 æãããããåå¼·ãã¦ãã¦ãããæ©ä¼ãªã®ã§ã¢ããã³ãã«ã¬ã³ãã¼ã«åå ãã¦ã¿ããã¨æãã¾ããã ç§ã¯ãã¾ãã¾ã Clojure ã«æ £ãã¦ãªãã®ã§ clojure.core ã®ãã¼ã ã¹ãã¼ã¹ãããã¾ãç®ç«ããªããã©æå¤ã«ä¾¿å©ãªé¢æ°ãç´¹ä»ãã¦ã¿ããã¨æãã¾ãã alter-meta! ä»ã®ãã¼ã ã¹ãã¼ã¹ãã Var ãæã£ã¦ãã¦å¥åãã¤ãããã¨ãããããã¨ãã«ãè½ã¡ã¦ãã¾ãã¡ã¿æ å ±ãä»ä¸ãããã¨ãã«ä½¿ãã¾ãã example.core> (def my-inc #'clojure.core/inc) #'example.core/my-inc example.core> (clojure.repl/doc my-inc) ------------------------- example.core/my-inc nil nil example.core>
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}