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
for directory in dirs: | |
%cd {directory} | |
!pwd | |
hva_files = !ls *.hva | |
for hva_file in hva_files: | |
!decode_hva.exe -f csv -o {hva_file[:-4]}%s.csv {hva_file} | |
%cd .. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 datetime import datetime, timedelta | |
def from_matlab_datetime(matlab_datenum): | |
return datetime.fromordinal(int(matlab_datenum)) + timedelta(days=matlab_datenum%1) - timedelta(days = 366) | |
def datetime2matlabdn(dt): | |
mdn = dt + timedelta(days = 366) | |
frac_seconds = (dt-datetime(dt.year,dt.month,dt.day,0,0,0)).seconds / (24.0 * 60.0 * 60.0) | |
frac_microseconds = dt.microsecond / (24.0 * 60.0 * 60.0 * 1000000.0) | |
return mdn.toordinal() + frac_seconds + frac_microseconds |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 os | |
b = !ls | |
cd C:\ffmpeg\bin | |
for file_name in b[6:]: | |
input_file = '"G:\\videos\\' + file_name + '"' | |
output_file = '"G:\\videos\\' + file_name[:-4] + '.mov"' | |
os.system('ffmpeg -i ' + input_file + " " + output_file) | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 os | |
import pandas as pd | |
os.chdir('D://J_Morrison//Data//Datawell//Siadar_HebMarine1') | |
wave_height_dfs = [] | |
for year in os.listdir('.'): | |
os.chdir(year) | |
for month in os.listdir('.'): | |
os.chdir(month) | |
wave_height_dfs.append(pd.read_hdf('buoy_data.h5','wave_height')) | |
os.chdir('..') |
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
def dedupe_df(df): | |
df['index'] = df.index | |
df = df.drop_duplicates(subset='index') | |
df = df.drop("index",1) | |
return df |