在Homestead中配置php.ini(Configuring php.ini in Homestead)
我试图通过指定更改我的php.ini文件中的变量max_input_vars
; How many GET/POST/COOKIE input variables may be accepted max_input_vars = 2500
并运行
sudo nginx -s reload
即使我在我的本地机器(C:\ xampp \ php \ php.ini)和Homestead(/etc/php5/fpm/php.ini)上将此变量设置为2500,我仍然收到以下错误消息
parse_str(): Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini
我知道.htaccess会在每个站点的基础上覆盖php.ini,有没有其他文件覆盖php.ini? 更改php.ini文件后是否还需要重新加载其他服务?
I am trying to change the variable max_input_vars in my php.ini file by specifying
; How many GET/POST/COOKIE input variables may be accepted max_input_vars = 2500
and running
sudo nginx -s reload
Even though I set this variable to 2500 on both my local machine (C:\xampp\php\php.ini) and on Homestead (/etc/php5/fpm/php.ini), I keep receiving the following error message
parse_str(): Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini
I know .htaccess overrides php.ini on a per site basis, are there any other files which override php.ini? Are there any other services that need to be reloaded after changing the php.ini file?
原文:https://stackoverflow.com/questions/32729033
最满意答案
'Restaurants' in businesses['categories']
的表达式'Restaurants' in businesses['categories']
返回布尔值False
。 这被传递给DataFrame业务的括号索引操作符,它不包含名为False的列,因此引发KeyError。你正在寻找的是一种叫做布尔索引的东西,它就像这样工作。
businesses[businesses['categories'] == 'Restaurants']
The expression
'Restaurants' in businesses['categories']
returns the boolean valueFalse
. This is passed to the brackets indexing operator for the DataFrame businesses which does not contain a column called False and thus raises a KeyError.What you are looking to do is something called boolean indexing which works like this.
businesses[businesses['categories'] == 'Restaurants']
相关问答
更多-
'Restaurants' in businesses['categories']的表达式'Restaurants' in businesses['categories']返回布尔值False 。 这被传递给DataFrame业务的括号索引操作符,它不包含名为False的列,因此引发KeyError。 你正在寻找的是一种叫做布尔索引的东西,它就像这样工作。 businesses[businesses['categories'] == 'Restaurants'] The expression 'Resta ...
-
在pandas DataFrame中为每个组选择1个True,1 False(Select 1 True, 1 False per group in a pandas DataFrame)[2024-02-26]
使用groupby和head 。 df.groupby(['Event ID', 'Won']).head(1) Event ID Runner ID Won 0 E1 R1 True 1 E1 R2 False 3 E2 R4 True 4 E2 R5 False 只要您对输出中保留的内容不挑剔,因为输出是平衡的。 还有drop_duplicates 。 df.drop_dup ... -
如何检查Pandas Dataframe的真或假 - Python(How to check Pandas Dataframe for True or False - Python)[2023-12-09]
不知道你为什么要这样做...但是使用itertuples for row in df.itertuples(): if row.check: print('Yes') Yes Yes Yes Yes Yes Yes Yes 您可以使用map来映射您的值 df.check.map({True: 'Yes', False: ''}) 0 1 2 3 Yes 4 5 6 7 ... -
如果需要替换boolean值True和False : booleandf = pandasDF.select_dtypes(include=[bool]) booleanDictionary = {True: 'TRUE', False: 'FALSE'} for column in booleandf: pandasDF[column] = pandasDF[column].map(booleanDictionary) 样品: pandasDF = pd.DataFrame({'A':[Tru ...
-
Pandas convert_to_r_dataframe函数KeyError(Pandas convert_to_r_dataframe function KeyError)[2024-01-29]
考虑使用rpy2自己的转换(在Linux上似乎与int64一起使用): # create a test DataFrame import numpy import pandas i2d = numpy.array([[1, 2, 3], [4, 5, 6]], dtype="int64") colnames = ('a', 'b', 'c') dataf = pandas.DataFrame(i2d, columns = colnames) # rpy ... -
如果你特别需要len ,那么@ MaxU的回答是最好的。 对于更通用的解决方案,您可以使用Series的映射方法。 df[df['amp'].map(len) == 495] 这将对每个元素应用len ,这就是你想要的。 使用这种方法,您可以使用任何函数,而不仅仅是len 。 If you specifically need len, then @MaxU's answer is best. For a more general solution, you can use the map method o ...
-
无论何时考虑执行赋值,都应该使用.loc : df.loc[null_index,'TOC_mg/L']=df['DOC_mg/L'] 原始代码中的错误是索引查找的下标值的排序: df['TOC_mg/L'][null_index] = df[null_index]['DOC_mg/L'] 会产生索引错误,我在玩具数据集上得到错误: IndexError: indices are out-of-bounds 如果您将订单更改为此可能会起作用: df['TOC_mg/L'][null_index] = d ...
-
你需要set_index + eq : df = df.set_index('obj1', drop=False).rename_axis(None) df = df.eq(df['obj1'], axis=0) print (df) obj1 obj2 obj3 attr1 True False True attr2 True False False attr3 True False False 类似方案: df = df.set_index('obj1', d ...
-
您希望为每个组获取索引。 它存储在groupbydataframe的'groups'属性中。 #filter for coverage==True #group by 'name' #access the 'groups' attribute by_person = df[df.coverage].groupby('name').groups 将返回: {'Jason': Int64Index([0, 5], dtype='int64'), 'Tina': Int64Index([4], dtype=' ...
-
您可以使用groupby申请: In [11]: g = df1.groupby(level='Group') In [12]: g.apply(lambda x: x <= df2.loc[x.name]) Out[12]: 2000-01-04 2000-01-05 Group Element 1 A False False X False Fa ...