axis

DataFrame的索引和基本操作

≡放荡痞女 提交于 2019-12-03 16:59:25
一、DataFrame的索引 1,选择列 1 import pandas as pd 2 import numpy as np 3 from pandas import Series, DataFrame 4 5 df = DataFrame(np.random.rand(12).reshape((3,4)), 6 index = ['one', 'two', 'three'], 7 columns= list('abcd') 8 ) 9 print(df) 10 type(df['a']) 11 df[['a','c']] # dataframe 注:df[ ]--选择列,整数可以选择行,但是不能单独选择,要用切片的方式如df[:2] 2,选择行 df1 = DataFrame(np.random.rand(12).reshape((3,4)), index = [3,2,1], columns= list('abcd') ) print(df1) df.loc['one'] # 单独的行,返回的也是一个Series对象 # df1.loc[0] # 整数的索引,只能是index 是默认的整数时 df.loc[['one','three','four']] # 多行,返回的也是一个Dataframe对象 df1.loc[2:1] # df.loc['two':'three'] #

tensorflow常用函数

非 Y 不嫁゛ 提交于 2019-12-03 15:21:43
tf.gather:用一个一维的索引数组,将张量中对应索引的向量提取出来 1 import tensorflow as tf 2 3 a = tf.Variable([[1,2,3,4,5], [6,7,8,9,10], [11,12,13,14,15]]) 4 index_a = tf.Variable([0,2]) 5 6 b = tf.Variable([1,2,3,4,5,6,7,8,9,10]) 7 index_b = tf.Variable([2,4,6,8]) 8 9 with tf.Session() as sess: 10 sess.run(tf.global_variables_initializer()) 11 print(sess.run(tf.gather(a, index_a))) 12 print(sess.run(tf.gather(b, index_b))) 13 14 # [[ 1 2 3 4 5] 15 # [11 12 13 14 15]] 16 17 # [3 5 7 9] np.stack() axis 参数指定新轴在结果尺寸中的索引。指定的索引,是新结果shape的第n个位置的值。例如,如果 axis=0 ,它将是第一个维度,如果 axis=-1 ,它将是最后一个维度。 参数: 数组:array_like的序列每个数组必须具有相同的形状

《DSP using MATLAB》Problem 8.41

旧街凉风 提交于 2019-12-03 15:13:55
代码: %% ------------------------------------------------------------------------ %% Output Info about this m-file fprintf('\n***********************************************************\n'); fprintf(' <DSP using MATLAB> Problem 8.41.2 \n\n'); banner(); %% ------------------------------------------------------------------------ % Digital lowpass Filter Specifications: wplp = 0.4*pi; % digital passband freq in rad wslp = 0.5*pi; % digital stopband freq in rad Rp = 1.0; % passband ripple in dB As = 50.0; % stopband attenuation in dB Ripple = 10 ^ (-Rp/20) % passband ripple in absolute Attn = 10 ^ (

How to enforce an Axis Client to use TLSv1.2 protocol

心已入冬 提交于 2019-12-03 13:55:18
A third party our application is integrate with has recently made changes in their security level protocols. In short, My Axis client should now send calls using TLSv1.1 or TLSv1.2. I have seen other posts regarding this, with some good ideas: here here . After making those changes in code, I have triggered the calls again, I have used a snipping tool to monitor the sent package, and I still see in the SSL layer that the protocol being used is TLSv1. the packet snippet what am I doing wrong here? this is how I set my new SocketSecureFactory: AxisProperties.setProperty("axis.socketSecureFactory

“java form generator” from a given wsdl file

≯℡__Kan透↙ 提交于 2019-12-03 13:40:43
I'm trying to develop a form generator in java, in which users will be able to write a wsdl url and get the list of the operations supported by the web service in a ComboBox. When the user selects one of the items in ComboBox then he will see form fields generated using the wsdl url. I'm a newbie in web service technologies, after searching about web service parsers on the net I decided to use axis library. But I really do not know which part of the wsdl document should I parse I'm not trying to create java classes of the web service, I have to generate form fields for any wsdl url. For

Two y axis with the same x-axis [duplicate]

╄→尐↘猪︶ㄣ 提交于 2019-12-03 13:04:06
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Plotting 4 curves in a single plot, with 3 y-axes assuming I have the following dataset as an example here in Matlab: x = linspace(0, 9, 10); y1=arrayfun(@(x) x^2,x); y2=arrayfun(@(x) 2*x^2,x); y3=arrayfun(@(x) x^4,x); thus you can see they have the SAME x-axis. Now I want the following plot: one x-axis with the limits 0 to 9 (those limits should also be ticks) with N ticks (I want to be able to define N myself)

[TensorFlow] argmax, softmax_cross_entropy_with_logits, sparse_softmax_cross_entropy_with_logits函数详解

夙愿已清 提交于 2019-12-03 12:59:05
写在前面 tensorFlow版本:1.8.0 一、tf.argmax() tf.argmax( input, axis= None , name= None , dimension= None , output_type=tf.int64 ) 1、argmax()的作用是返回数组某一行或某一列最大数值所在的下标 2、input:输入矩阵 3、 axis:指定按行操作还是按列操作 此函数在使用时最重要的两个参数是input和axis,axis可选的取值是0和1。axis=0表示对矩阵按列进行argmax操作,axis=1表示对矩阵按行进行argmax操作。 举例如下: import tensorflow as tf data = tf.constant( [[1, 5, 4], [2, 3, 6]] , dtype=tf.float32) # 定义一个 2 * 3 的矩阵 argmax_axis_0 = tf.argmax(data, 0 ) # 按列 argmax_axis_1 = tf.argmax(data, 1 ) # 按行 with tf.Session() as sess: value_axis_0 = sess.run(argmax_axis_0) value_axis_1 = sess.run(argmax_axis_1) print ( "value_axis_0

pandas数据操作

回眸只為那壹抹淺笑 提交于 2019-12-03 12:29:12
import pandas as pd import numpy as np # Series是一个一维数组的对象 # 1.通过列表创建Series对象 # 由索引和数据组成的,左边是索引 右边是数据 ser_obj = pd.Series(range(10,20)) # 获取索引 RangeIndex是索引的类型 print(ser_obj.index) # 获取值 print(ser_obj.values) # head()函数 默认查看前5条数据 ,可以传入制定查看数据的条数 print(ser_obj.head()) # 根据索引取出数据 print(ser_obj[5]) # 基本运算 print(ser_obj**2) # 筛选数据 print(ser_obj>15) # 取出符合条件的数据 print(ser_obj[ser_obj>15]) # 2.通过字典构建series对象,字典中的key作为索引,值作为值 索引类型:Int64Index student = { 2001:15.5, 2005:20.4, 2008:26.5 } # 传入字典 ser_obj = pd.Series(student) # 指定索引名称 ser_obj.index.name = 'year' # 指定series对象名称 ser_obj.name = 'GDP' # 3

AXIS vs JAX-WS for Web Service Client

南笙酒味 提交于 2019-12-03 12:13:00
I am deciding on the implementation of Web Service Client in Java. I've generated Axis client in Eclipse and JAS-WS client with wsimport. Both solutions work and now I have to choose one to go forward. What should I think about before picking one over the other? The client side of JAX-WS is part of the standard Java API, and the reference implementation is reliable and performant, while Axis requires 3rd party dependencies. If you don't need any functionality implemented by Axis and not offered by JAX-WS, I really don't see any reason why you should opt for Axis and not for JAX-WS. One thing

JAVA调用远程webservice(wsdl) Demo

会有一股神秘感。 提交于 2019-12-03 11:18:55
在调用web service接口时,根据网上查找的demo,都有问题,经过1天的研究,终于明白了调用web service的原理,下面例子便是测试的demo,比较容易理解。 1.首先配置pom文件: <!--spring web Service的包--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web-services</artifactId> <version>1.5.2.RELEASE</version> </dependency> <!--spring web service wsdl包--> <dependency> <groupId>wsdl4j</groupId> <artifactId>wsdl4j</artifactId> <version>1.6.3</version> </dependency> <!-- axis 1.4 jar start --> <dependency> <groupId>org.apache.axis</groupId> <artifactId>axis</artifactId> <version>1.4</version> </dependency> <dependency> <groupId