Pandas numpy.std filed in element wise groupby + apply

From SO:np.random.seed([3,14159])df = pd.DataFrame( np.random.randint(10, size=(3, 3, 5)).tolist(), list('XYZ'), l...

Pandas if condition for pandas DataFrame

import pandas as pddf = pd.DataFrame({'A':[15,14,90,65,20,45],'B':[98,87,45,25,12,5]})df['C'] = (df['A']>df['B']) and...

Pandas allow read_sql to avoid conversion to float

Code Sampleimport ibm_db_dbiimport ibm_dbimport pandas as pdconn_str = "DATABASE=<...>;HOSTNAME=<...>;P...

Pandas On concatenating dataframes: NoneType object is not iterable

Code Sample, a copy-pastable example if possibleimport ioimport pandascsv_file = io.StringIO("""datetime,...

Pandas If condition in DataFrame

Code Sample, a copy-pastable example if possible# Your code hereimport pandas as pddf = pd.DataFrame({'A'=[1,2,3],'B'=[3...

Pandas read_hdf throws UnicodeDecodeError with Python 3.5 and 3.6 but not with Python 2.7

Code Sample, a copy-pastable example if possibleimport pandas as pddf = pd.read_hdf('data.h5')Problem descriptionThe HDF...

Pandas BUG: Transpose fails on DataFrame with timestamps having timezone

CodeIn [33]: df = pd.DataFrame({'date1': [Timestamp('2017-05-25 14:02:23'), NaT], 'date2': [Timestamp('2017-...

Pandas Wired KeyError when indexing DatetimeIndex

import pandas as pdfrom datetime import *#Creat a sample DataFrame, df.d={'foo':1, 'bar':2}index=['2017-09-13']df=pd.Dat...

Pandas Timezone handling unittest failures on Debian

Hi,While buildling pandas 0.20.3 on Debian I had 3 timezone handling related test failures.I also get the 3 errors when ...

Pandas Documentation example for pd.read_msgpack throws exception

The code example in the documentation for read_msgpack throws a SyntaxError due to Python 2 syntax for printing:In [319]...

Pandas groupby.var result is different than np.var

With the groupby.var, I don't have the same result with numpy.I use the variance formula, it seems that numpy is correct...

Pandas Timestamp modified after creating a new pd.Dataframe in Pymongo?

Not sure why original Series in my df["date_real"], after using it to create another df_release_detail the timestamp got...

Pandas Accessing all user-created metadata of a pandas Series

Code Sample, a copy-pastable example if possibleimport pandas as pdimport numpy as nps = pd.Series(np.random.randn(10))s...

Pandas .loc[...] = value returns SettingWithCopyWarning

Code Sample# My codedf.loc[0, 'column_name'] = 'foo bar'Problem descriptionThis code in Pandas 20.3 throws SettingWithCo...

Pandas pandas groupby/aggregation operation changes 'key' column dtype

reference: https://stackoverflow.com/questions/34059704/pandas-groupby-aggregation-operation-changes-key-column-dtypeWhe...

Pandas pandas_datareader.data: Google does no longer provide historical stock data?

It seems that Google does no longer provide historical stock data respectively Google does no longer update the data. Is...

Pandas BUG: .iloc does not accept boolean series

Code Sample, a copy-pastable example if possible>>> s = pd.Series([3,4,5])>>> b = s > 3>>>...

Pandas DataFrame columns.values gives a reference to the original column instead of a copy

Code Sample, a copy-pastable example if possibleimport pandas as pdimport numpy as npprint "pd.__version__: %s&quot...

Pandas Incorrect weekofyear via .dt accessor

Incorrect dt.weekofyear calculation? I was expecting weekofyear/week for 20050101 would be 0In [1442]: dfOut[1442]: A...

Pandas Comparison between DataFrame and Series containing datetime and other types

import pandas as pdimport datetime as dtd = pd.DataFrame([[1, dt.datetime(1990,12,10)], [2, dt.datetime...
上一页 下一页
.