Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Fix pandas deprecation of pd.Int64Index
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsm committed May 25, 2022
1 parent 63ca40f commit 4afbed3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions grblc/fitting/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ def check_header(path, n=None, debug=False, more_than_one_row=False):

h = df.columns


# todo: if header is Int64Index, check the 2nd row (i.e. first row of data for the not isfloat)
# ... so maybe change the h in [not isfloat(x) for x in h] to the second row???
if isinstance(h, pd.Int64Index) or sum(isfloat(x) for x in h) >= 0.3 * len(h) // 1:
if isinstance(h, type(pd.Index([], dtype=int))) or sum(isfloat(x) for x in h) >= 0.3 * len(h) // 1:
if debug:
print("Some are floats...")

Expand All @@ -65,7 +66,7 @@ def check_datatype(filename):
Given a filename, try and guess what dataset the data comes from
(e.g., Si, Kann, Oates, etc.)
For example, a file named '*_Oates.txt' will be interpreted as data in the same format
For example, a file named `*_Oates.txt` will be interpreted as data in the same format
as Sam Oates' data.
"""
Expand Down

0 comments on commit 4afbed3

Please sign in to comment.