Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import os
import matplotlib.pyplot as plt
import numpy as np
#%% Read csv file
files = os.listdir('.')
for file_name in files:
if file_name.startswith('dat') and file_name.endswith('.csv'):
dat = pd.read_csv(file_name)
dat_xr = dat.set_index(['speed', 'seed', 'backoff', 'downstream'])
import pandas as pd
import os
import matplotlib.pyplot as plt
import numpy as np
#%% Read csv file
files = os.listdir('.')
for file_name in files:
if file_name.startswith('dat') and file_name.endswith('.csv'):
dat = pd.read_csv(file_name)
dat_xr = dat.set_index(['speed', 'seed', 'backoff', 'downstream'])
import pandas as pd
import csv
import os
import matplotlib.pyplot as plt
import numpy as np
#%% Read csv file
files = os.listdir('.')
for file_name in files:
if file_name.startswith('dat') and file_name.endswith('.csv'):
dat = pd.read_csv(file_name)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import netCDF4
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import datetime
import calendar
from scipy.interpolate import griddata
from mpl_toolkits.basemap import Basemap
from scipy.interpolate import RegularGridInterpolator
plt.rcParams['figure.dpi'] = 600
@Piinshin
Piinshin / Wave_final_v2.ipynb
Created December 25, 2023 07:40
1225_波浪理論作業更正版
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Piinshin
Piinshin / Wave_final.ipynb
Created December 23, 2023 06:56
波浪理論期末報告
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import matplotlib.pyplot as plt
def k(wavelength):
return (2*np.pi/wavelength)
def c(g,k,h):
return np.sqrt(g*np.tanh(k*h)/k)
def G(k,h):
return 2*k*h/np.sinh(2*k*h)
def cg(g,k,h):
@Piinshin
Piinshin / Mid_RR _mlk.ipynb
Created November 12, 2023 04:30
RR模式(莫拉克颱風),計算水力學期中報告
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Piinshin
Piinshin / Mid_RR.ipynb
Created November 12, 2023 04:29
RR模式(梅姬颱風),計算水力學期中報告
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.