Pandas warning lines are deprecated, use index 'instead'

I am working with Kaggle Titanic dataset using pandas in iPython notebook.

When I create a pivot table, I get the following warning:

FutureWarning: strings are deprecated, use index warnings.warn (msg, FutureWarning) instead

Is this something I should be worried about? I just created a pivot table:

import pandas as pd
df = pd.read_csv('https://dl.dropboxusercontent.com/u/5743203/data/titanic/titanic_train.csv')
fare_means = df.pivot_table('Fare', rows='Pclass', aggfunc='mean')

      

Also, when I try to use the values ​​in the pivot table to populate the NA values, I get the following warning:

FutureWarning: scalar indexes for index type Int64Index must be integer, not floating point type (by itself). name ), FutureWarning

df['Fare'] = df[['Fare', 'Pclass']].apply(lambda x:
                fare_means[x['Pclass']] if pd.isnull(x['Fare'])
                else x['Fare'], axis=1)

      

+3
python pandas pivot-table kaggle


source to share


No one has answered this question yet

Check out similar questions:

3247
Index access in 'for' loops?
2818
Finding the index of an element by specifying the list that contains it in Python
1646
Why is it string.join (list) instead of list.join (string)?
1553
Renaming columns in pandas
1462
How to iterate over rows in a DataFrame in Pandas?
1419
Select rows from DataFrame based on values ​​in column in pandas
1033
Remove column from panda DataFrame
873
Big data workflows using pandas
815
Adding a new column to an existing DataFrame in Python pandas
640
How can I get the number of rows in a pandas DataFrame?



All Articles
Loading...
X
Show
Funny
Dev
Pics