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


source to share





All Articles