-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DataFrame.fillna() working on row vector instead of column vector? #15522
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
Labels
Milestone
Comments
can you show |
>>> df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 24311 entries, 0 to 24310
Data columns (total 19 columns):
time 24311 non-null datetime64[ns, UTC]
id 24311 non-null int64
bid 1469 non-null float64
bid_depth 7988 non-null float64
bid_depth_total 11630 non-null float64
bid_number 10765 non-null float64
offer 1370 non-null float64
offer_depth 7864 non-null float64
offer_depth_total 10617 non-null float64
offer_number 9940 non-null float64
open 1085 non-null float64
high 1086 non-null float64
low 1085 non-null float64
last 1223 non-null float64
change 1223 non-null float64
change_percent 1223 non-null float64
volume 3697 non-null float64
value 3697 non-null float64
trades 3697 non-null float64
dtypes: datetime64[ns, UTC](1), float64(17), int64(1)
memory usage: 3.5 MB |
Something to do with datetimetz. Here's a simpler repro: df = pd.DataFrame({'date': pd.date_range('2014-01-01', periods=5, tz='US/Central')})
df.fillna(method='pad')
ValueError Traceback (most recent call last)
<ipython-input-77-8f5ecb26a2f6> in <module>()
----> 1 df.fillna(method='pad') |
yeah need to handle these in the Block correctly (the tz) |
@MatSalm easy way to do this is (though not super pretty)
|
Thank you |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Code Sample, a copy-pastable example if possible
Problem description
msgpack of dataframe for replication:
https://www.dropbox.com/s/5skf6v8x2vg103o/dataframe?dl=0
I'm a beginner so I can only guess at what is wrong, but it seems to be working on rows instead of the columns. I can loop through df.columns and do it series by series to end up with the expected output so it doesn't seem to me as if it is a problem with any of the columns.
Expected Output
Fill the columns of NaN's with prior value in column.
Output of
pd.show_versions()
pandas: 0.19.2
nose: None
pip: 9.0.1
setuptools: 34.2.0
Cython: None
numpy: 1.12.0
scipy: None
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.1.5
pymysql: None
psycopg2: 2.6.2 (dt dec pq3 ext lo64)
jinja2: None
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: