Skip to content

Commit

Permalink
included xlsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Franz Masatoshi Yuri committed Sep 16, 2022
1 parent 6093de3 commit b4f5560
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rocketpy/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
__copyright__ = "Copyright 20XX, RocketPy Team"
__license__ = "MIT"

import os
import numpy as np
import pandas as pd
from scipy.integrate import solve_ivp
Expand Down Expand Up @@ -213,7 +214,13 @@ def create_dispersion_dictionary(dic):
dictionary
Dictionary with all rocket data used in dispersion analysis.
"""
dataframe = pd.read_csv(dic, sep=";", skiprows=[0, 1], header=None)

file = os.path.splitext(dic)
if file[-1] == ".csv":
dataframe = pd.read_csv(dic, skiprows=[0, 1], header=None)
elif file[-1] == ".xlsx":
dataframe = pd.read_excel(dic, skiprows=[0, 1], header=None)


rocketKeys = list(dataframe[1].dropna())
rocketValues = list(dataframe[2].dropna())
Expand Down

0 comments on commit b4f5560

Please sign in to comment.