This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#必要なライブラリのインポート | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.linear_model import LinearRegression | |
%matplotlib inline | |
#ファイル読み込み | |
df = pd.read_csv("downloaded_japan_population_utf8.csv") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###ライブラリ読み込み | |
import pandas as pd | |
import numpy as np | |
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import japanize_matplotlib | |
###csv読み込む | |
covid_data = pd.read_csv("(都合によりURLのあちこちにスペース入ってるけど、使う時はスペース除いてください)https:// stopcovid19. metro. tokyo. lg. jp/ data/ 130001_tokyo_covid19_patients. csv", index_col="公表_年月日", parse_dates=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ライブラリ読み込み | |
import pandas as pd | |
import numpy as np | |
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import japanize_matplotlib | |
#日付記述を日付データとしてcsv読み込む | |
covid_data = pd.read_csv("(都合によりURLのあちこちにスペース入ってるけど、使う時はスペース除いてください)https:// stopcovid19. metro. tokyo. lg. jp/ data/ 130001_tokyo_covid19_patients. csv", index_col="公表_年月日", parse_dates=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from PIL import Image | |
tokyo_tower = Image.open("tokyo_tower.png") | |
tower_color = np.array(tokyo_tower) | |
rgb = [0] * 6 | |
j = 0 | |
for i in range(0, 5, 2): | |
rgb[i], rgb[i+1] = np.histogram(tower_color[:, :, j].flatten(), bins=256) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from PIL import Image | |
tokyo_tower = Image.open("tokyo_tower.png") | |
tower_color = np.array(tokyo_tower) | |
hist_r, bins_r = np.histogram(tower_color[:, :, 0].flatten(), bins=256) | |
hist_g, bins_g = np.histogram(tower_color[:, :, 1].flatten(), bins=256) | |
hist_b, bins_b = np.histogram(tower_color[:, :, 2].flatten(), bins=256) | |
plt.figure(figsize=(10, 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import numpy as np | |
i=0 | |
x=np.arange(1,11) | |
y=np.zeros(10) | |
while i <=9: | |
y[i]=np.random.uniform(1,10) | |
i +=1 | |
plt.plot(x,y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ライブラリのインポートなど | |
from PIL import Image | |
import matplotlib.pyplot as plt | |
import numpy as np | |
%matplotlib inline | |
#画像の読み込み | |
rocket_org = Image.open("H2A.jpg") | |
#画像をndarrayに変換 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import matplotlib.pyplot as plt | |
import numpy as np | |
%matplotlib inline | |
#画像の読み込み | |
rocket_org = Image.open("H2A.jpg") | |
#画像をndarrayに変換 | |
rocket_org_array = np.array(rocket_org) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from PIL import Image | |
tokyo_tower = Image.open("tokyo_tower.png") | |
tower_color = np.array(tokyo_tower) | |
rgbcolor = ["red", "green", "blue"] | |
rgb_list = [0] * 3 | |
for i in range(3): | |
rgb0, rgb1 = np.histogram(tower_color[:, :, i].flatten(), bins=256) |
NewerOlder