-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
DOC: Adding examples for dtype_backend="pyarrow" for read_json() #52813
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
doc/source/user_guide/io.rst
Outdated
'"e":{"0":null,"1":6.0},"f":{"0":null,"1":7.5},"g":{"0":null,"1":true},"h":{"0":null,"1":"a"},' | ||
'"i":{"0":"12-31-2019","1":"12-31-2019"},"j":{"0":null,"1":null}}' | ||
) | ||
pd.read_json(StringIO(data), dtype_backend="pyarrow") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do
df = pd.read_json(StringIO(data), dtype_backend="pyarrow")
df
df.dtypes
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
doc/source/user_guide/io.rst
Outdated
import io | ||
data = io.StringIO("date\n12 Jan 2000\n2000-01-13\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import io | |
data = io.StringIO("date\n12 Jan 2000\n2000-01-13\n") | |
data = StringIO("date\n12 Jan 2000\n2000-01-13\n") |
It seems that all other examples use StringIO(..)
instead of io.StringIO(..)
, the the StringIO
object itself was already imported. So this should fix the error as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one other usage of io.StringIO
a few lines below that would need to be updated as well (but I can't comment on that line)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removed the import and it fixed the error
thx @Dharni0607 |
Thanks again Dharani! |
Added an example for dtype_backend="pyarrow" for read_json()
dtype_backend="pyarrow"
noatamir/pyladies-workshop#2doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.