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

TimeSeries.to_dataframe(): Bad columns in output DataFrame when data is empty. #59

Open
felixchenier opened this issue Aug 2, 2021 · 0 comments
Labels
bug Something isn't working severity:low This bug rarely happens and it does not affect the validity of the results

Comments

@felixchenier
Copy link
Collaborator

Describe the bug
When a TimeSeries has multidimensional data shape but first dimension is 0 (no data), its to_dataframe() method doesn't produce the right DataFrame columns.

To Reproduce
df = pd.DataFrame(columns=['Data0', 'Data1[0,0]', 'Data1[0,1]',
'Data1[1,0]', 'Data1[1,1]'])
df['Data0'] = np.array([])
df['Data1[0,0]'] = np.array([])
df['Data1[0,1]'] = np.array([])
df['Data1[1,0]'] = np.array([])
df['Data1[1,1]'] = np.array([])

ts = ktk.TimeSeries.from_dataframe(df)
assert ts.data['Data0'].shape == (0,)
assert ts.data['Data1'].shape == (0, 2, 2)

df2 = ts.to_dataframe()
assert np.all(df == df2)

Expected behavior
df and df2 should be identical.

@felixchenier felixchenier added the bug Something isn't working label Aug 2, 2021
@felixchenier felixchenier self-assigned this Aug 2, 2021
@felixchenier felixchenier modified the milestone: 0.6 Aug 2, 2021
@felixchenier felixchenier added the severity:low This bug rarely happens and it does not affect the validity of the results label Aug 3, 2021
@felixchenier felixchenier added this to the 0.8 milestone Mar 6, 2022
@felixchenier felixchenier modified the milestones: 0.8, 0.9 Jun 29, 2022
@felixchenier felixchenier modified the milestones: 0.9, 0.10 Aug 3, 2022
@felixchenier felixchenier removed this from the 0.9.3 milestone Sep 20, 2022
@felixchenier felixchenier removed their assignment Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working severity:low This bug rarely happens and it does not affect the validity of the results
Projects
None yet
Development

No branches or pull requests

1 participant