-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Closed
Labels
API DesignBugIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves
Milestone
Description
I'm getting spurious warnings on some old code that I'm running with new pandas. You can replicate by doing something like this (you have to take a subset of the data first, that's the key)
import pandas as pd
from pandas.core.common import SettingWithCopyWarning
from string import letters
import warnings
warnings.simplefilter('error', SettingWithCopyWarning)
def random_text(nobs=100):
df = []
for i in range(nobs):
idx= np.random.randint(len(letters), size=2)
idx.sort()
df.append([letters[idx[0]:idx[1]]])
return pd.DataFrame(df, columns=['letters'])
df = random_text(100000)
df = df.ix[df.letters.apply(lambda x : len(x) > 10)]
df['letters'] = df['letters'].apply(str.lower)
Metadata
Metadata
Assignees
Labels
API DesignBugIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves