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

Transfer Datadict form to pandas.dataframe #387

Merged
merged 7 commits into from
May 12, 2023

Conversation

MuyaoSun
Copy link
Contributor

@MuyaoSun MuyaoSun commented Apr 17, 2023

edited file: datadict.py; edited functin: datadict_todataframe
transfer any dimension datadict into pandas.dataframe.
def datadict_todataframe(data: DataDict)->pd.DataFrame:

example of use:
DataDict A = ...
DataFrame B = datadict_todataframe(B)

Copy link
Collaborator

@marcosfrenkel marcosfrenkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the branch before I approve and merge this PR

1 x2 y2 z2
2 x3 y3 z3
...
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow the style of documentation found in the file. Docstring is too indented, function name does not follow camel case, no mention of the parameter data, the break-lines are not consistent. Fix spelling mistakes: to _datafarme is nothing, lables.

2 x3 y3 z3
...
"""
dat_set = {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the missing a

dimension_check = False

if np.size(data.data_vals(key)) > max_ele:
max_ele = np.size(data.data_vals(key))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's usually nice to add a space in between control blocks, makes it more clear where something ends and the next thing starts

Copy link
Collaborator

@marcosfrenkel marcosfrenkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants