Skip to content

TST: new test for str to small float conversion dtype #29372

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

Conversation

ganevgv
Copy link
Contributor

@ganevgv ganevgv commented Nov 2, 2019

@simonjayhawkins simonjayhawkins added the Testing pandas testing functions or related to the test suite label Nov 2, 2019
col_data = [str(np.random.random() * 1e-12) for _ in range(5)]

df = pd.DataFrame(col_data, columns=["A"])
assert df["A"].dtype == np.object_
Copy link
Member

Choose a reason for hiding this comment

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

For these two assertions, can you construct the expected dataframe result and use tm.assert_frame_equal?

result = ...
expected = ...
tm.assert_frame_equal(result, expected)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback, @mroeschke! Changed the test accordingly.

@jreback jreback added the Numeric Operations Arithmetic, Comparison, and Logical operations label Nov 3, 2019
@jreback jreback added this to the 1.0 milestone Nov 3, 2019
@jreback
Copy link
Contributor

jreback commented Nov 3, 2019

lgtm pending @mroeschke comment

@mroeschke mroeschke merged commit 8c38b24 into pandas-dev:master Nov 3, 2019
@mroeschke
Copy link
Member

Thanks @ganevgv!

Reksbril pushed a commit to Reksbril/pandas that referenced this pull request Nov 18, 2019
* add str to small float conversion type test

* restrucutre test
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
* add str to small float conversion type test

* restrucutre test
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
* add str to small float conversion type test

* restrucutre test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Numeric Operations Arithmetic, Comparison, and Logical operations Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect column dtype conversion from object to int for small floating point numbers
4 participants