• Skip to main content
  • Skip to primary sidebar

学習記録

Python 基本

Jupyterでzip等圧縮ファイル解凍

2017年12月5日 by 河副 太智 Leave a Comment

JupyterのNewからPython3を選択

Jupyter上で解凍
1
2
3
import zipfile
with zipfile.ZipFile("スクレイピング.zip","r") as zip_ref:
    zip_ref.extractall("")

 

Filed Under: Python 基本 Tagged With: Jupyter

文字コード UTF-8,Shift JIS

2017年11月30日 by 河副 太智 Leave a Comment

 

UTF-8で書かれた文字列(ファイル)

1
2
私の名前は山田太郎です。
 

Shift JISでデコード

1
2
3
遘√�蜷榊燕縺ッ螻ア逕ー螟ェ驛弱〒縺吶
 
Big 5-Eは中国語繁体字に使われるエンコード形式

Filed Under: Python 基本

辞書{[…]}

2017年11月29日 by 河副 太智 Leave a Comment

1
2
3
4
5
a = {"fruits": ["apple", "orange", "banana", "strawberry", "kiwifruit"],
        "year": [2001, 2002, 2001, 2008, 2006],
        "amount": [1, 4, 5, 6, 3]}
​
print(a)

{‘fruits’: [‘apple’, ‘orange’, ‘banana’, ‘strawberry’, ‘kiwifruit’], ‘year’: [2001, 2002, 2001, 2008, 2006], ‘amount’: [1, 4, 5, 6, 3]}

Filed Under: Python 基本

csvを作成して追加

2017年11月29日 by 河副 太智 Leave a Comment

import csv

import time
from datetime import datetime

with open(‘csv0.csv’, ‘w’) as csvfile:
writer = csv.writer(csvfile, lineterminator=’\n’)
writer.writerow([‘2’, ‘3’, ‘5’])
writer.writerow([‘7′, ’11’, ’13’])

writer.writerow([datetime.now(),value])#関数、変数もカンマ区切りで入る

csv0.csvというファイルが同じディレクトリに生成される

Filed Under: Python 基本

Jupyterの文、単語を検索

2017年11月29日 by 河副 太智 Leave a Comment

find ./ -type f -print | xargs grep ‘キーワード’

Filed Under: Python 基本

辞書型は{key,value}

2017年11月28日 by 河副 太智 Leave a Comment

辞書型は{key,value}

Filed Under: Python 基本

  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • Go to Next Page »

Primary Sidebar

カテゴリー

  • AWS
  • Bootstrap
  • Dash
  • Django
  • flask
  • GIT(sourcetree)
  • Plotly/Dash
  • VPS
  • その他tool
  • ブログ
  • プログラミング
    • Bokeh
    • css
    • HoloViews
    • Jupyter
    • Numpy
    • Pandas
    • PosgreSQL
    • Python 基本
    • python3
      • webアプリ
    • python3解説
    • scikit-learn
    • scipy
    • vps
    • Wordpress
    • グラフ
    • コマンド
    • スクレイピング
    • チートシート
    • データクレンジング
    • ブロックチェーン
    • 作成実績
    • 時系列分析
    • 機械学習
      • 分析手法
      • 教師有り
    • 異常値検知
    • 自然言語処理
  • 一太郎
  • 数学
    • sympy
      • 対数関数(log)
      • 累乗根(n乗根)
    • 暗号学

Copyright © 2025 · Genesis Sample on Genesis Framework · WordPress · Log in