Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the re-sort error in join_csv function #1

Merged
merged 1 commit into from
Jun 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixed the re-sort error in join_csv function
  • Loading branch information
Shimingyi committed Jun 24, 2019
commit c3fa6bfa24de37823ce157f6893df3f12a1e34e0
6 changes: 3 additions & 3 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ def main(img_path, json_path=None):

def join_csv():
path = 'hmr/output/csv/'
all_files = glob.glob(os.path.join(path, "*.csv") )

df_from_each_file = (pd.read_csv(f) for f in sorted(all_files))
all_files = glob.glob(os.path.join(path, "*.csv"))
all_files.sort(key=lambda x: int(x.split('/')[-1].split('.')[0]))
df_from_each_file = (pd.read_csv(f) for f in all_files)
concatenated_df = pd.concat(df_from_each_file, ignore_index=True)

concatenated_df['frame'] = concatenated_df.index+1
Expand Down