Let's create a data frame by hand.[Python]View PlainCopy
Import NumPy as NP
Import Pandas as PD
DF = PD. DataFrame (Np.arange (0,2). Reshape (3), columns=list (' abc ' )
DF is such a dropSo how do you choose the three ways to pick the data?One, when each column already has column name, with DF [' a '] can choose to take out a whole column of data. If you know column names and index, and both are well-entered, you can choose.
I believe many people like me in the process of learning Python,pandas data selection and modification has a great deal of confusion (perhaps by the Matlab) impact ...
To this day finally completely figure out ...
Let's start with a data box manually.
Import NumPy as NP
import pandas as PD
DF = PD. Dataframe (Np.arange (0,60,2). Reshape (10,3), columns=list (' abc ')DF is such a drop
So what are the three ways to choose the data?
First, when column
This article mainly introduces you to the pandas in Python. Dataframe to exclude specific lines of the method, the text gives a detailed example code, I believe that everyone's understanding and learning has a certain reference value, the need for friends to see together below. When you use Python for data analysis, one of the most frequently used structures is the dataframe of pandas, about pandas in Pytho
background
Items
Pandas
Spark
Working style
Stand-alone, unable to process large amounts of data
Distributed, capable of processing large amounts of data
Storage mode
Stand-alone cache
Can call Persist/cache distributed cache
is variable
Is
Whether
Index indexes
Automatically created
No index
Row structure
Pandas.series
Pyspark.sql.Row
Column structure
Pa
Tomcat _ startup error: Caused by: java.util.zip. ZipException: invalid LOC header (bad signature) at java. uti solution,
1.The error java.util.zip. ZipException: invalid LOC header is returned.
Today, I tried a new JavaWEB project in IDEA. After the environment is configured, it cannot be started. This problem has plagued me for four hours and finally solved the problem. The record is as follows:
Error mes
Tags: progress convert ror mem intern com Enable a sigpackage on Eclipse, error:[INFO] Including org.codehaus.groovy:groovy-all:jar:2.4.3 in the shaded jar. [INFO]------------------------------------------------------------------------[INFO] BUILD Failure[info]-------- ----------------------------------------------------------------[INFO] Total time:8.269 s[info] finished at: 2017-11-06t11:08:57+08:00[info] Final Memory:62m/644m[info]----------------------------------------------------- --------
When you use eclipse to package maven projects, the invalid LOC header (bad signature) exception is reported. eclipsemavenWhen packaging on eclipse, an error is returned:
[INFO] Including org.codehaus.groovy:groovy-all:jar:2.4.3 in the shaded jar.[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 8.269 s[INF
Error reading XXX while maven compiling invalid LOC header (bad signature)First, the problem foundRight-click Pom.xml,run as-> maven install and see the Times in the console mavenrepository\repos\org\mortbay\jetty\servlet-api-2.5\ 6.1h.14.1\servlet-api-2.5-6.1h.14.1.jar error, such as some packet errors and other similar information, pom.xml display Red fork.Second, reason analysisThe package is not downloaded correctly.Iii. SolutionsLocate the direct
Some time ago downloaded from the Internet dubbo-admin found in the jdk1.7 is not available, and later according to the online upgrade of the jar package version or there is a problem, and then observed that the compilation found that the compilation appears similar to the following exception:----------------------------------------------------Maven Compile Error: Errors: An error occurred while reading C:\workspaces\maven-3.3.9\repository\commons-lang\commons-lang\2.5\commons-lang-2.5.jar; Reso
The problem is a lot of things on the internet.
The question is how to find the jar with the problem.I'll record my solution here.When maven install, a careful look at log will prompt a problem jarFollow the path to remove the jar and then install again.
[WARNING] Read C:\Users\coffee\.m2\repository\com\github\fernandospr\javapns-jdk16\2.3.1\ Javapns-jdk16-2.3.1.jar error; Invalid LOC header (bad signature)
[WARNING] Read C:\Users\coffee\.m2\reposit
Example:
Unable to process Jar entry [Org/apache/taglibs/standard/lang/jstl/lessthanorequalsoperator.class] from Jar [Jar:jndi :/localhost/app/web-inf/lib/standard-1.1.2.jar!/] for annotations
java.util.zip.ZipException:invalid LOC Header (bad signature)
Today in the start of the Tomcat times this anomaly, many times the reason for the error is because the jar packet download is not correct, you can delete the corresponding jar newspaper, download,
When viewing dataframe information, you can view the data in Dataframe by Collect (), show (), or take (), which contains the option to limit the number of rows returned.
1. View the number of rows
You can use the count () method to view the number of dataframe rows
From pyspark.sql import sparksession
spark= sparksession\
. Builder \.
0.0 0.0 0.0 NaN2 NaN 1.0 1.0 1.0 1.03 NaN 1.0 1.0 1.0 1.04 NaN 1.0 1.0 1.0 1.0 DF1 = Df1.append ([DF2, Df3], ignore_index=true) # You can add more than one DF at a time, or you can ignore indexA b c d E0 0.0 0.0 0.0 0.0 NaN1 0.0 0.0 0.0 0.0 NaN2 0.0 0.0 0.0 0.0 NaN3 NaN 1.0 1.0 1.0 1.04 NaN 1.0 1.0 1.0 1.05 NaN 1.0 1.0 1.0 1.06 NaN 2.0 2.0 2.0 2.07 NaN 2.0 2.0 2.0 2.08 NaN 2.0 2.0 2.0 2.0 S1=PD. Series ([1,2,3,4],index=[' A ', ' B ', ' C ', ' d '])DF1 = Df1.append (S1, ignore_index=true) # can
Python array, list, And dataframe index slicing operations: July 22, July 19, 2016-zhi Lang document,Array, list, And dataframe index slicing operations: January 1, July 19, 2016-zhi Lang document
List, one-dimensional, two-dimensional array, datafrme, loc, iloc, and ix
Numpy array index and slice introduction:Starting from the basic list index, let's start with
1: Deploy a good project, start Tomcat appears the following error, Baidu method, quite a lot of, but it does not seem to solve my problem, the problem is as follows:1 java.util.zip.ZipException:invalid LOC Header (bad signature)2 At Java.util.zip.ZipFile.read (Native Method)3At java.util.zip.zipfile.access$1400(Unknown Source)4 At Java.util.zip.zipfile$zipfileinputstream.read (Unknown Source)5 At Java.util.zip.zipfile$zipfileinflaterinputstream.fill
Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:4962)
At Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:152)
... Ten more
caused by:org.apache.catalina.LifecycleException:Failed to initialize component [ ORG.APACHE.CATALINA.WEBRESOURCES.JARRESOURCESET@6B892F81]
At Org.apache.catalina.util.LifecycleBase.init (lifecyclebase.java:112)
At Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:141)
At Org.apache.catalina.webresources.StandardR
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.