-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Fixing some more warnings #26810
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4703,6 +4703,7 @@ See the documentation for `pyarrow <https://arrow.apache.org/docs/python/>`__ an | |
Write to a parquet file. | ||
|
||
.. ipython:: python | ||
:okwarning: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, this is fine. Although, we should actually make sure to install the latest version of pyarrow (where this is fixed), but for some reason conda installs 0.11 instead of 0.13 |
||
|
||
df.to_parquet('example_pa.parquet', engine='pyarrow') | ||
df.to_parquet('example_fp.parquet', engine='fastparquet') | ||
|
@@ -4720,6 +4721,7 @@ Read from a parquet file. | |
Read only certain columns of a parquet file. | ||
|
||
.. ipython:: python | ||
:okwarning: | ||
|
||
result = pd.read_parquet('example_fp.parquet', | ||
engine='fastparquet', columns=['a', 'b']) | ||
|
@@ -4742,6 +4744,7 @@ Serializing a ``DataFrame`` to parquet may include the implicit index as one or | |
more columns in the output file. Thus, this code: | ||
|
||
.. ipython:: python | ||
:okwarning: | ||
|
||
df = pd.DataFrame({'a': [1, 2], 'b': [3, 4]}) | ||
df.to_parquet('test.parquet', engine='pyarrow') | ||
|
@@ -4758,6 +4761,7 @@ If you want to omit a dataframe's indexes when writing, pass ``index=False`` to | |
:func:`~pandas.DataFrame.to_parquet`: | ||
|
||
.. ipython:: python | ||
:okwarning: | ||
|
||
df.to_parquet('test.parquet', index=False) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -348,14 +348,21 @@ that, by default, performs linear interpolation at missing data points. | |
np.random.seed(123456) | ||
idx = pd.date_range('1/1/2000', periods=100, freq='BM') | ||
ts = pd.Series(np.random.randn(100), index=idx) | ||
ts[1:20] = np.nan | ||
ts[1:5] = np.nan | ||
ts[20:30] = np.nan | ||
ts[60:80] = np.nan | ||
ts = ts.cumsum() | ||
|
||
.. ipython:: python | ||
|
||
ts | ||
ts.count() | ||
@savefig series_before_interpolate.png | ||
ts.interpolate().plot() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be without the interpolate? As the above line is already included a couple of lines below There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch, I saw it when reviewing the rendered page, and thought I fixed it, but seems like I didn't |
||
|
||
.. ipython:: python | ||
|
||
ts.interpolate() | ||
ts.interpolate().count() | ||
|
||
@savefig series_interpolate.png | ||
|
@@ -435,9 +442,9 @@ Compare several methods: | |
|
||
np.random.seed(2) | ||
|
||
ser = pd.Series(np.arange(1, 10.1, .25)**2 + np.random.randn(37)) | ||
bad = np.array([4, 13, 14, 15, 16, 17, 18, 20, 29]) | ||
ser[bad] = np.nan | ||
ser = pd.Series(np.arange(1, 10.1, .25) ** 2 + np.random.randn(37)) | ||
missing = np.array([4, 13, 14, 15, 16, 17, 18, 20, 29]) | ||
ser[missing] = np.nan | ||
methods = ['linear', 'quadratic', 'cubic'] | ||
|
||
df = pd.DataFrame({m: ser.interpolate(method=m) for m in methods}) | ||
|
@@ -455,7 +462,7 @@ at the new values. | |
ser = pd.Series(np.sort(np.random.uniform(size=100))) | ||
|
||
# interpolate at new_index | ||
new_index = ser.index | pd.Index([49.25, 49.5, 49.75, 50.25, 50.5, 50.75]) | ||
new_index = pd.Float64Index(ser.index | pd.Index([49.25, 49.5, 49.75, 50.25, 50.5, 50.75])) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would leave this change out. Yes, it is annoying that it fails, but this should work and is a regression we need to fix (and we actually catched this due to the docs). If this is the final error that is remaining and blocking that we can start failing CI for errors/warnings in the docs, then we can do that or add a temporary There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adding an |
||
interp_s = ser.reindex(new_index).interpolate(method='pchip') | ||
interp_s[49:51] | ||
|
||
|
@@ -476,6 +483,7 @@ filled since the last valid observation: | |
|
||
ser = pd.Series([np.nan, np.nan, 5, np.nan, np.nan, | ||
np.nan, 13, np.nan, np.nan]) | ||
ser | ||
|
||
# fill all consecutive values in a forward direction | ||
ser.interpolate() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,6 @@ v0.17.1 (November 21, 2015) | |
|
||
{{ header }} | ||
|
||
.. ipython:: python | ||
:suppress: | ||
|
||
|
||
|
||
.. note:: | ||
|
||
|
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.
This should not be added, the warning in the log is indicating a recent regression, see #26770