Skip to content

Commit b4f5560

Browse files
author
Franz Masatoshi Yuri
committed
included xlsx
1 parent 6093de3 commit b4f5560

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rocketpy/utilities.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
__copyright__ = "Copyright 20XX, RocketPy Team"
44
__license__ = "MIT"
55

6+
import os
67
import numpy as np
78
import pandas as pd
89
from scipy.integrate import solve_ivp
@@ -213,7 +214,13 @@ def create_dispersion_dictionary(dic):
213214
dictionary
214215
Dictionary with all rocket data used in dispersion analysis.
215216
"""
216-
dataframe = pd.read_csv(dic, sep=";", skiprows=[0, 1], header=None)
217+
218+
file = os.path.splitext(dic)
219+
if file[-1] == ".csv":
220+
dataframe = pd.read_csv(dic, skiprows=[0, 1], header=None)
221+
elif file[-1] == ".xlsx":
222+
dataframe = pd.read_excel(dic, skiprows=[0, 1], header=None)
223+
217224

218225
rocketKeys = list(dataframe[1].dropna())
219226
rocketValues = list(dataframe[2].dropna())

0 commit comments

Comments
 (0)