Explore all Insurance related open source software, libraries, packages, source code, cloud functions and APIs.

The insurance sector is made up of companies that offer risk management in the form of insurance contracts. Life insurance companies focus on legacy planning and replacing human capital value, health insurers cover medical costs, and property, casualty, or accident insurance is aimed at replacing the value of homes, cars, or valuables.

These software components cover functions across Actuarial, Agent, Broker, Claims, Enrollment, Renewal, Underwriting areas.

Popular New Releases in Insurance

Android-Image-Cropper

4.2.1

manage-azure-policy

bLUe_PYSIDE2

v5.1.0

neo-blockchain-toolkit

Neo N3 Support

dnn.azureadb2cprovider

DNN Azure AD B2C Provider v1.5.0

Popular Libraries in Insurance

Android-Image-Cropper

by CanHub doticonkotlindoticon

star image 506 doticonApache-2.0

Image Cropping Library for Android, optimised for Camera / Gallery.

STEAD

by smousavi05 doticonpythondoticon

star image 81 doticonCC-BY-4.0

STanford EArthquake Dataset (STEAD):A Global Data Set of Seismic Signals for AI

tornado-cli

by tornadocash doticonjavascriptdoticon

star image 74 doticon

A command line interface to make transactions in Tornado Cash protocol

enterprise-policy-generator

by cadeyrn doticonjavascriptdoticon

star image 50 doticonMPL-2.0

The Enterprise Policy Engine allows administrators to configure Firefox via a configuration file. The Enterprise Policy Generator helps to create the configuration file.

CPL

by INK-USC doticonpythondoticon

star image 48 doticonMIT

Collaborative Policy Learning for Open Knowledge Graph Reasoning (EMNLP 2019)

Deterministic-GAIL-PyTorch

by nikhilbarhate99 doticonpythondoticon

star image 47 doticonMIT

PyTorch implementation of Deterministic Generative Adversarial Imitation Learning (GAIL) for Off Policy learning

NexusMutual

by somish doticonjavascriptdoticon

star image 42 doticonGPL-3.0

Nexus Mutual uses the power of blockchain technology and Ethereum to allow people from all over the world to share insurance risk together without the need for an insurance company. Nexus Mutual is now launched on Ethereum Mainnet. Buy Smart Contract Cover at https://app.nexusmutual.io

apibusinesshub-api-recipes

by SAP doticonjavascriptdoticon

star image 42 doticonNOASSERTION

Accelerate integration projects using SAP Cloud Platform API Management with crowdsourced best practices, curated by experts, designed for developers.

MOREL

by vik-goel doticonpythondoticon

star image 41 doticonMIT

Trending New libraries in Insurance

Android-Image-Cropper

by CanHub doticonkotlindoticon

star image 506 doticonApache-2.0

Image Cropping Library for Android, optimised for Camera / Gallery.

tornado-cli

by tornadocash doticonjavascriptdoticon

star image 74 doticon

A command line interface to make transactions in Tornado Cash protocol

manage-azure-policy

by Azure doticontypescriptdoticon

star image 35 doticonMIT

GiHub Action to manage Azure policy from GitHub workflows

opa-express-middleware

by build-security doticonjavascriptdoticon

star image 35 doticonMIT

Node.JS Express middleware for working with the Open Policy Agent

Map-Elites-Evolutionary

by uber-research doticonpythondoticon

star image 19 doticonNOASSERTION

Map-Elites based on Evolution Strategies

opa-traefik-microservice-authz

by appsecco doticonjavascriptdoticon

star image 18 doticonMIT

Proof of concept implementation of a scenario using Open Policy Agent for microservices authorization in API Gateway (Traefik).

opa-spring-security

by Bisnode doticonjavadoticon

star image 13 doticonApache-2.0

Open Policy Agent for Spring Security

KinovaGrasping

by OSUrobotics doticonpythondoticon

star image 13 doticon

This contains the simulation of a kinova robot and the code for collecting data and training both a grasp classifier and a RL agent

Readinizer

by CompassSecurity doticoncsharpdoticon

star image 11 doticonMIT

Microsoft GPO Readiness Lateral Movement Detection Tool

Top Authors in Insurance

1

ForgeRock

2 Libraries

star icon29

2

Bisnode

2 Libraries

star icon21

3

DataVisor

2 Libraries

star icon0

4

Turall

1 Libraries

star icon14

5

qiaochen

1 Libraries

star icon7

6

tobiasemrich

1 Libraries

star icon9

7

kimhc6028

1 Libraries

star icon25

8

brutusin

1 Libraries

star icon10

9

SonRossy

1 Libraries

star icon4

10

IBM-Cloud

1 Libraries

star icon6

1

2 Libraries

star icon29

2

2 Libraries

star icon21

3

2 Libraries

star icon0

4

1 Libraries

star icon14

5

1 Libraries

star icon7

6

1 Libraries

star icon9

7

1 Libraries

star icon25

8

1 Libraries

star icon10

9

1 Libraries

star icon4

10

1 Libraries

star icon6

Trending Kits in Insurance

No Trending Kits are available at this moment for Insurance

Trending Discussions on Insurance

What is the best way to Null check input fields in the request object in Java?

How to match and merge XML in database?

Foreign key created in shadow and appending random 1 to column name - ASP:NET EF Core

How to collapse the ExpansionTile on button click? - Flutter

I have a dataset in which i have two columns with time in it but the dat

How do I resolve list index out of range error?

Write an Effective query for django for a FOR Loop?

Combining values in a tuple that contain both string and integers values and storing as a dataframe

Error when using case_when with mutate and functions: getting closest number to zero with NA

How to remove parent json element in python3 if child is object is empty

QUESTION

What is the best way to Null check input fields in the request object in Java?

Asked 2022-Apr-17 at 07:22

I have a Code Like this:

Insurance Dto:

1 private String accidentNo;
2 private String birthDate;
3 private String mobileNo;
4 private String ssn;
5
6 public InsuranceDto(String accidentNo, String birthDate, String mobileNo, String ssn) {
7    this.accidentNo = accidentNo;
8    this.birthDate = birthDate;
9    this.mobileNo = mobileNo;
10    this.ssn = ssn;
11 }
12
13 public InsuranceDto() {}
14
15 public String getAccidentNo() {
16    return accidentNo;
17 }
18
19 public void setAccidentNo(String accidentNo) {
20    this.accidentNo = accidentNo;
21 }
22
23 public String getBirthDate() {
24    return birthDate;
25 }
26
27 public void setBirthDate(String birthDate) {
28    this.birthDate = birthDate;
29 }
30
31 public String getMobileNo() {
32    return mobileNo;
33 }
34
35 public void setMobileNo(String mobileNo) {
36    this.mobileNo = mobileNo;
37 }
38
39 public String getSsn() {
40    return ssn;
41 }
42
43 public void setSsn(String ssn) {
44    this.ssn = ssn;
45 }
46

Main Method:

1 private String accidentNo;
2 private String birthDate;
3 private String mobileNo;
4 private String ssn;
5
6 public InsuranceDto(String accidentNo, String birthDate, String mobileNo, String ssn) {
7    this.accidentNo = accidentNo;
8    this.birthDate = birthDate;
9    this.mobileNo = mobileNo;
10    this.ssn = ssn;
11 }
12
13 public InsuranceDto() {}
14
15 public String getAccidentNo() {
16    return accidentNo;
17 }
18
19 public void setAccidentNo(String accidentNo) {
20    this.accidentNo = accidentNo;
21 }
22
23 public String getBirthDate() {
24    return birthDate;
25 }
26
27 public void setBirthDate(String birthDate) {
28    this.birthDate = birthDate;
29 }
30
31 public String getMobileNo() {
32    return mobileNo;
33 }
34
35 public void setMobileNo(String mobileNo) {
36    this.mobileNo = mobileNo;
37 }
38
39 public String getSsn() {
40    return ssn;
41 }
42
43 public void setSsn(String ssn) {
44    this.ssn = ssn;
45 }
46 InsuranceDto insuranceDto = new InsuranceDto();
47
48 if (insuranceDto.getAccidentNo() == null)
49     throw new RuntimeException("Enter AccidentNo.");
50 if (insuranceDto.getBirthDate() == null)
51     throw new RuntimeException("Enter BirthDate.");
52 if (insuranceDto.getMobileNo() == null)
53     throw new RuntimeException("Enter MobileNo");
54 if (insuranceDto.getSsn() == null)
55     throw new RuntimeException("Enter SSN");
56

So the Code Works but its Kind of Garbage and if I Add 3 Other Fields to InsuranceDTO, I Have to Edit the Entire Code to Validate them. Imagen if the Validation Policy Gets more Complicated and you Need to Validate two and/or more Fields in one If statement At Once.

So How Can I avoid this? Is There a Design Pattern or Something else to Make it Better? Thanks in advance.

ANSWER

Answered 2022-Apr-17 at 06:51

Since you are trying to reduce the amount of code, I can suggest you to Use Lombok @Data annotation to get intrinsic getters and setters as well, this way you can avoid the whole getter setter methods which can reduce a lot of code. The way your InsuranceDto looks after you implement lombok is:

1 private String accidentNo;
2 private String birthDate;
3 private String mobileNo;
4 private String ssn;
5
6 public InsuranceDto(String accidentNo, String birthDate, String mobileNo, String ssn) {
7    this.accidentNo = accidentNo;
8    this.birthDate = birthDate;
9    this.mobileNo = mobileNo;
10    this.ssn = ssn;
11 }
12
13 public InsuranceDto() {}
14
15 public String getAccidentNo() {
16    return accidentNo;
17 }
18
19 public void setAccidentNo(String accidentNo) {
20    this.accidentNo = accidentNo;
21 }
22
23 public String getBirthDate() {
24    return birthDate;
25 }
26
27 public void setBirthDate(String birthDate) {
28    this.birthDate = birthDate;
29 }
30
31 public String getMobileNo() {
32    return mobileNo;
33 }
34
35 public void setMobileNo(String mobileNo) {
36    this.mobileNo = mobileNo;
37 }
38
39 public String getSsn() {
40    return ssn;
41 }
42
43 public void setSsn(String ssn) {
44    this.ssn = ssn;
45 }
46 InsuranceDto insuranceDto = new InsuranceDto();
47
48 if (insuranceDto.getAccidentNo() == null)
49     throw new RuntimeException("Enter AccidentNo.");
50 if (insuranceDto.getBirthDate() == null)
51     throw new RuntimeException("Enter BirthDate.");
52 if (insuranceDto.getMobileNo() == null)
53     throw new RuntimeException("Enter MobileNo");
54 if (insuranceDto.getSsn() == null)
55     throw new RuntimeException("Enter SSN");
56@Data
57@NoArgsConstructor
58@AllArgsConstructor
59@Build
60public class InsuranceDto {
61    @NotNull(message ="Accident Number must not be empty null")
62    private String accidentNo;
63    @NotNull(message ="Sample field 2 must not be empty null")
64    private String samplefield2;
65}
66

Lombok repository in Maven:

1 private String accidentNo;
2 private String birthDate;
3 private String mobileNo;
4 private String ssn;
5
6 public InsuranceDto(String accidentNo, String birthDate, String mobileNo, String ssn) {
7    this.accidentNo = accidentNo;
8    this.birthDate = birthDate;
9    this.mobileNo = mobileNo;
10    this.ssn = ssn;
11 }
12
13 public InsuranceDto() {}
14
15 public String getAccidentNo() {
16    return accidentNo;
17 }
18
19 public void setAccidentNo(String accidentNo) {
20    this.accidentNo = accidentNo;
21 }
22
23 public String getBirthDate() {
24    return birthDate;
25 }
26
27 public void setBirthDate(String birthDate) {
28    this.birthDate = birthDate;
29 }
30
31 public String getMobileNo() {
32    return mobileNo;
33 }
34
35 public void setMobileNo(String mobileNo) {
36    this.mobileNo = mobileNo;
37 }
38
39 public String getSsn() {
40    return ssn;
41 }
42
43 public void setSsn(String ssn) {
44    this.ssn = ssn;
45 }
46 InsuranceDto insuranceDto = new InsuranceDto();
47
48 if (insuranceDto.getAccidentNo() == null)
49     throw new RuntimeException("Enter AccidentNo.");
50 if (insuranceDto.getBirthDate() == null)
51     throw new RuntimeException("Enter BirthDate.");
52 if (insuranceDto.getMobileNo() == null)
53     throw new RuntimeException("Enter MobileNo");
54 if (insuranceDto.getSsn() == null)
55     throw new RuntimeException("Enter SSN");
56@Data
57@NoArgsConstructor
58@AllArgsConstructor
59@Build
60public class InsuranceDto {
61    @NotNull(message ="Accident Number must not be empty null")
62    private String accidentNo;
63    @NotNull(message ="Sample field 2 must not be empty null")
64    private String samplefield2;
65}
66<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
67<dependency>
68    <groupId>org.projectlombok</groupId>
69    <artifactId>lombok</artifactId>
70    <version>1.18.22</version>
71    <scope>provided</scope>
72</dependency>
73

And to your question, In InsuranceDto, you can attach the @Data once you have the lombok, for example above the field accidentNo in the InsuranceDto, you can have

1 private String accidentNo;
2 private String birthDate;
3 private String mobileNo;
4 private String ssn;
5
6 public InsuranceDto(String accidentNo, String birthDate, String mobileNo, String ssn) {
7    this.accidentNo = accidentNo;
8    this.birthDate = birthDate;
9    this.mobileNo = mobileNo;
10    this.ssn = ssn;
11 }
12
13 public InsuranceDto() {}
14
15 public String getAccidentNo() {
16    return accidentNo;
17 }
18
19 public void setAccidentNo(String accidentNo) {
20    this.accidentNo = accidentNo;
21 }
22
23 public String getBirthDate() {
24    return birthDate;
25 }
26
27 public void setBirthDate(String birthDate) {
28    this.birthDate = birthDate;
29 }
30
31 public String getMobileNo() {
32    return mobileNo;
33 }
34
35 public void setMobileNo(String mobileNo) {
36    this.mobileNo = mobileNo;
37 }
38
39 public String getSsn() {
40    return ssn;
41 }
42
43 public void setSsn(String ssn) {
44    this.ssn = ssn;
45 }
46 InsuranceDto insuranceDto = new InsuranceDto();
47
48 if (insuranceDto.getAccidentNo() == null)
49     throw new RuntimeException("Enter AccidentNo.");
50 if (insuranceDto.getBirthDate() == null)
51     throw new RuntimeException("Enter BirthDate.");
52 if (insuranceDto.getMobileNo() == null)
53     throw new RuntimeException("Enter MobileNo");
54 if (insuranceDto.getSsn() == null)
55     throw new RuntimeException("Enter SSN");
56@Data
57@NoArgsConstructor
58@AllArgsConstructor
59@Build
60public class InsuranceDto {
61    @NotNull(message ="Accident Number must not be empty null")
62    private String accidentNo;
63    @NotNull(message ="Sample field 2 must not be empty null")
64    private String samplefield2;
65}
66<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
67<dependency>
68    <groupId>org.projectlombok</groupId>
69    <artifactId>lombok</artifactId>
70    <version>1.18.22</version>
71    <scope>provided</scope>
72</dependency>
73@NotNull(message ="Accident Number must not be empty null")
74private String accidentNo;
75

This way you can completely avoid the null checks within your service class because it will throw a runtime exception when such a null values comes in even before hitting your service. The validation is automatic.

Edit: If you're only trying to avoid null checks you can use Apache commons.

1 private String accidentNo;
2 private String birthDate;
3 private String mobileNo;
4 private String ssn;
5
6 public InsuranceDto(String accidentNo, String birthDate, String mobileNo, String ssn) {
7    this.accidentNo = accidentNo;
8    this.birthDate = birthDate;
9    this.mobileNo = mobileNo;
10    this.ssn = ssn;
11 }
12
13 public InsuranceDto() {}
14
15 public String getAccidentNo() {
16    return accidentNo;
17 }
18
19 public void setAccidentNo(String accidentNo) {
20    this.accidentNo = accidentNo;
21 }
22
23 public String getBirthDate() {
24    return birthDate;
25 }
26
27 public void setBirthDate(String birthDate) {
28    this.birthDate = birthDate;
29 }
30
31 public String getMobileNo() {
32    return mobileNo;
33 }
34
35 public void setMobileNo(String mobileNo) {
36    this.mobileNo = mobileNo;
37 }
38
39 public String getSsn() {
40    return ssn;
41 }
42
43 public void setSsn(String ssn) {
44    this.ssn = ssn;
45 }
46 InsuranceDto insuranceDto = new InsuranceDto();
47
48 if (insuranceDto.getAccidentNo() == null)
49     throw new RuntimeException("Enter AccidentNo.");
50 if (insuranceDto.getBirthDate() == null)
51     throw new RuntimeException("Enter BirthDate.");
52 if (insuranceDto.getMobileNo() == null)
53     throw new RuntimeException("Enter MobileNo");
54 if (insuranceDto.getSsn() == null)
55     throw new RuntimeException("Enter SSN");
56@Data
57@NoArgsConstructor
58@AllArgsConstructor
59@Build
60public class InsuranceDto {
61    @NotNull(message ="Accident Number must not be empty null")
62    private String accidentNo;
63    @NotNull(message ="Sample field 2 must not be empty null")
64    private String samplefield2;
65}
66<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
67<dependency>
68    <groupId>org.projectlombok</groupId>
69    <artifactId>lombok</artifactId>
70    <version>1.18.22</version>
71    <scope>provided</scope>
72</dependency>
73@NotNull(message ="Accident Number must not be empty null")
74private String accidentNo;
75 org.apache.commons.lang3.Validate
76

Usage: If the accidentNo is null, an error is thrown with the string you give as a second argument.

1 private String accidentNo;
2 private String birthDate;
3 private String mobileNo;
4 private String ssn;
5
6 public InsuranceDto(String accidentNo, String birthDate, String mobileNo, String ssn) {
7    this.accidentNo = accidentNo;
8    this.birthDate = birthDate;
9    this.mobileNo = mobileNo;
10    this.ssn = ssn;
11 }
12
13 public InsuranceDto() {}
14
15 public String getAccidentNo() {
16    return accidentNo;
17 }
18
19 public void setAccidentNo(String accidentNo) {
20    this.accidentNo = accidentNo;
21 }
22
23 public String getBirthDate() {
24    return birthDate;
25 }
26
27 public void setBirthDate(String birthDate) {
28    this.birthDate = birthDate;
29 }
30
31 public String getMobileNo() {
32    return mobileNo;
33 }
34
35 public void setMobileNo(String mobileNo) {
36    this.mobileNo = mobileNo;
37 }
38
39 public String getSsn() {
40    return ssn;
41 }
42
43 public void setSsn(String ssn) {
44    this.ssn = ssn;
45 }
46 InsuranceDto insuranceDto = new InsuranceDto();
47
48 if (insuranceDto.getAccidentNo() == null)
49     throw new RuntimeException("Enter AccidentNo.");
50 if (insuranceDto.getBirthDate() == null)
51     throw new RuntimeException("Enter BirthDate.");
52 if (insuranceDto.getMobileNo() == null)
53     throw new RuntimeException("Enter MobileNo");
54 if (insuranceDto.getSsn() == null)
55     throw new RuntimeException("Enter SSN");
56@Data
57@NoArgsConstructor
58@AllArgsConstructor
59@Build
60public class InsuranceDto {
61    @NotNull(message ="Accident Number must not be empty null")
62    private String accidentNo;
63    @NotNull(message ="Sample field 2 must not be empty null")
64    private String samplefield2;
65}
66<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
67<dependency>
68    <groupId>org.projectlombok</groupId>
69    <artifactId>lombok</artifactId>
70    <version>1.18.22</version>
71    <scope>provided</scope>
72</dependency>
73@NotNull(message ="Accident Number must not be empty null")
74private String accidentNo;
75 org.apache.commons.lang3.Validate
76Validate.notNull(accidentNo, "accidentNo cannot be null")
77

Source https://stackoverflow.com/questions/71899535

QUESTION

How to match and merge XML in database?

Asked 2022-Feb-04 at 16:06

I have below mixed documents in one collection.

1B3:
2    <creditRisk>
3      <characteristic>
4        <score>
5            <LID>C230</LID>
6            <SPID>129587</SPID>
7            <Sector>Finance and Insurance</Sector>
8        </score>
9        <score>
10            <LID>C177</LID>
11            <SPID>360720</SPID>
12            <Sector>Mining and Oil and Gas Extraction</Sector>
13        </score>
14      </characteristic>
15    </creditRisk>
16 
17B4:
18    <creditRisk>
19      <pit>
20        <score>
21            <LID>C230</LID>           
22            <SPID>129587</SPID>
23            <LTV>1.4689503</LTV>
24            <LGD>0.5995806998</LGD>
25            <Logarithm>-0.915243031</Logarithm>
26        </score>
27        <score>
28            <LID>C177</LID>            
29            <SPID>360720</SPID>
30            <LTV>1.524224737</LTV>
31            <LGD>0.8989534312</LGD>
32            <Logarithm>-2.292173791</Logarithm>
33        </score>
34      </pit>
35</creditRisk>
36

At the moment to simplify the problem, I need to merge pit/score@B4 when its SPID equals to characteristic/score/SPID@B3 inside MarkLogic. 

Expected Output:

1B3:
2    <creditRisk>
3      <characteristic>
4        <score>
5            <LID>C230</LID>
6            <SPID>129587</SPID>
7            <Sector>Finance and Insurance</Sector>
8        </score>
9        <score>
10            <LID>C177</LID>
11            <SPID>360720</SPID>
12            <Sector>Mining and Oil and Gas Extraction</Sector>
13        </score>
14      </characteristic>
15    </creditRisk>
16 
17B4:
18    <creditRisk>
19      <pit>
20        <score>
21            <LID>C230</LID>           
22            <SPID>129587</SPID>
23            <LTV>1.4689503</LTV>
24            <LGD>0.5995806998</LGD>
25            <Logarithm>-0.915243031</Logarithm>
26        </score>
27        <score>
28            <LID>C177</LID>            
29            <SPID>360720</SPID>
30            <LTV>1.524224737</LTV>
31            <LGD>0.8989534312</LGD>
32            <Logarithm>-2.292173791</Logarithm>
33        </score>
34      </pit>
35</creditRisk>
36<characteristic>
37   <score>
38      <default>
39         <LID>C230</LID>
40         <SPID>129587</SPID>
41         <LTV>1.4689503</LTV>
42         <LGD>0.5995806998</LGD>
43         <Logarithm>-0.915243031</Logarithm>
44      </default>
45      <LID>C230</LID>
46      <SPID>129587</SPID>
47      <Sector>Finance and Insurance</Sector>
48   </score>
49   <score>
50      <default>
51         <LID>C177</LID>
52         <SPID>360720</SPID>
53         <LTV>1.524224737</LTV>
54         <LGD>0.8989534312</LGD>
55         <Logarithm>-2.292173791</Logarithm>
56      </default>
57      <LID>C177</LID>
58      <SPID>360720</SPID>
59      <Sector>Mining and Oil and Gas Extraction</Sector>
60   </score>
61</characteristic>
62

We are facing issue. My xsl comes out all blank results.

1B3:
2    <creditRisk>
3      <characteristic>
4        <score>
5            <LID>C230</LID>
6            <SPID>129587</SPID>
7            <Sector>Finance and Insurance</Sector>
8        </score>
9        <score>
10            <LID>C177</LID>
11            <SPID>360720</SPID>
12            <Sector>Mining and Oil and Gas Extraction</Sector>
13        </score>
14      </characteristic>
15    </creditRisk>
16 
17B4:
18    <creditRisk>
19      <pit>
20        <score>
21            <LID>C230</LID>           
22            <SPID>129587</SPID>
23            <LTV>1.4689503</LTV>
24            <LGD>0.5995806998</LGD>
25            <Logarithm>-0.915243031</Logarithm>
26        </score>
27        <score>
28            <LID>C177</LID>            
29            <SPID>360720</SPID>
30            <LTV>1.524224737</LTV>
31            <LGD>0.8989534312</LGD>
32            <Logarithm>-2.292173791</Logarithm>
33        </score>
34      </pit>
35</creditRisk>
36<characteristic>
37   <score>
38      <default>
39         <LID>C230</LID>
40         <SPID>129587</SPID>
41         <LTV>1.4689503</LTV>
42         <LGD>0.5995806998</LGD>
43         <Logarithm>-0.915243031</Logarithm>
44      </default>
45      <LID>C230</LID>
46      <SPID>129587</SPID>
47      <Sector>Finance and Insurance</Sector>
48   </score>
49   <score>
50      <default>
51         <LID>C177</LID>
52         <SPID>360720</SPID>
53         <LTV>1.524224737</LTV>
54         <LGD>0.8989534312</LGD>
55         <Logarithm>-2.292173791</Logarithm>
56      </default>
57      <LID>C177</LID>
58      <SPID>360720</SPID>
59      <Sector>Mining and Oil and Gas Extraction</Sector>
60   </score>
61</characteristic>
62    <xsl:template match="characteristic">   
63        <characteristic>
64        <xsl:call-template name="scoreSPID">
65          <xsl:with-param name="characterScore" select="score"/>
66        </xsl:call-template>
67        </characteristic>
68    </xsl:template>
69 
70    <xsl:template name="scoreSPID">
71        <xsl:param name="characterScore"/>
72        <xsl:for-each select="$characterScore">
73        <xsl:variable name="spid" select="SPID"/>
74            <score>
75              <xsl:for-each select="/creditRisk/pit/score[SPID eq $spid]">
76              <default>
77                <xsl:copy-of select="./node()"/>
78              </default>
79              <xsl:copy-of select="node()"/>
80              </xsl:for-each>
81            </score>     
82        </xsl:for-each>
83    </xsl:template>  
84   
85    <xsl:template match="node()">
86      <xsl:apply-templates/>
87</xsl:template>
88

How can I get the match/merge work in my xsl? Do note B3 and B4 are different dokuments in the same database.

ANSWER

Answered 2022-Feb-01 at 04:20

In the predicate filter for the for-each:

1B3:
2    <creditRisk>
3      <characteristic>
4        <score>
5            <LID>C230</LID>
6            <SPID>129587</SPID>
7            <Sector>Finance and Insurance</Sector>
8        </score>
9        <score>
10            <LID>C177</LID>
11            <SPID>360720</SPID>
12            <Sector>Mining and Oil and Gas Extraction</Sector>
13        </score>
14      </characteristic>
15    </creditRisk>
16 
17B4:
18    <creditRisk>
19      <pit>
20        <score>
21            <LID>C230</LID>           
22            <SPID>129587</SPID>
23            <LTV>1.4689503</LTV>
24            <LGD>0.5995806998</LGD>
25            <Logarithm>-0.915243031</Logarithm>
26        </score>
27        <score>
28            <LID>C177</LID>            
29            <SPID>360720</SPID>
30            <LTV>1.524224737</LTV>
31            <LGD>0.8989534312</LGD>
32            <Logarithm>-2.292173791</Logarithm>
33        </score>
34      </pit>
35</creditRisk>
36<characteristic>
37   <score>
38      <default>
39         <LID>C230</LID>
40         <SPID>129587</SPID>
41         <LTV>1.4689503</LTV>
42         <LGD>0.5995806998</LGD>
43         <Logarithm>-0.915243031</Logarithm>
44      </default>
45      <LID>C230</LID>
46      <SPID>129587</SPID>
47      <Sector>Finance and Insurance</Sector>
48   </score>
49   <score>
50      <default>
51         <LID>C177</LID>
52         <SPID>360720</SPID>
53         <LTV>1.524224737</LTV>
54         <LGD>0.8989534312</LGD>
55         <Logarithm>-2.292173791</Logarithm>
56      </default>
57      <LID>C177</LID>
58      <SPID>360720</SPID>
59      <Sector>Mining and Oil and Gas Extraction</Sector>
60   </score>
61</characteristic>
62    <xsl:template match="characteristic">   
63        <characteristic>
64        <xsl:call-template name="scoreSPID">
65          <xsl:with-param name="characterScore" select="score"/>
66        </xsl:call-template>
67        </characteristic>
68    </xsl:template>
69 
70    <xsl:template name="scoreSPID">
71        <xsl:param name="characterScore"/>
72        <xsl:for-each select="$characterScore">
73        <xsl:variable name="spid" select="SPID"/>
74            <score>
75              <xsl:for-each select="/creditRisk/pit/score[SPID eq $spid]">
76              <default>
77                <xsl:copy-of select="./node()"/>
78              </default>
79              <xsl:copy-of select="node()"/>
80              </xsl:for-each>
81            </score>     
82        </xsl:for-each>
83    </xsl:template>  
84   
85    <xsl:template match="node()">
86      <xsl:apply-templates/>
87</xsl:template>
88<xsl:for-each select="/creditRisk/pit/score[SPID eq spid]">
89

you want to filter where the SPID is equal to the variable $spid. Without the $ it is looking for a sibling element spid (which doesn't exist).

It should be:

1B3:
2    <creditRisk>
3      <characteristic>
4        <score>
5            <LID>C230</LID>
6            <SPID>129587</SPID>
7            <Sector>Finance and Insurance</Sector>
8        </score>
9        <score>
10            <LID>C177</LID>
11            <SPID>360720</SPID>
12            <Sector>Mining and Oil and Gas Extraction</Sector>
13        </score>
14      </characteristic>
15    </creditRisk>
16 
17B4:
18    <creditRisk>
19      <pit>
20        <score>
21            <LID>C230</LID>           
22            <SPID>129587</SPID>
23            <LTV>1.4689503</LTV>
24            <LGD>0.5995806998</LGD>
25            <Logarithm>-0.915243031</Logarithm>
26        </score>
27        <score>
28            <LID>C177</LID>            
29            <SPID>360720</SPID>
30            <LTV>1.524224737</LTV>
31            <LGD>0.8989534312</LGD>
32            <Logarithm>-2.292173791</Logarithm>
33        </score>
34      </pit>
35</creditRisk>
36<characteristic>
37   <score>
38      <default>
39         <LID>C230</LID>
40         <SPID>129587</SPID>
41         <LTV>1.4689503</LTV>
42         <LGD>0.5995806998</LGD>
43         <Logarithm>-0.915243031</Logarithm>
44      </default>
45      <LID>C230</LID>
46      <SPID>129587</SPID>
47      <Sector>Finance and Insurance</Sector>
48   </score>
49   <score>
50      <default>
51         <LID>C177</LID>
52         <SPID>360720</SPID>
53         <LTV>1.524224737</LTV>
54         <LGD>0.8989534312</LGD>
55         <Logarithm>-2.292173791</Logarithm>
56      </default>
57      <LID>C177</LID>
58      <SPID>360720</SPID>
59      <Sector>Mining and Oil and Gas Extraction</Sector>
60   </score>
61</characteristic>
62    <xsl:template match="characteristic">   
63        <characteristic>
64        <xsl:call-template name="scoreSPID">
65          <xsl:with-param name="characterScore" select="score"/>
66        </xsl:call-template>
67        </characteristic>
68    </xsl:template>
69 
70    <xsl:template name="scoreSPID">
71        <xsl:param name="characterScore"/>
72        <xsl:for-each select="$characterScore">
73        <xsl:variable name="spid" select="SPID"/>
74            <score>
75              <xsl:for-each select="/creditRisk/pit/score[SPID eq $spid]">
76              <default>
77                <xsl:copy-of select="./node()"/>
78              </default>
79              <xsl:copy-of select="node()"/>
80              </xsl:for-each>
81            </score>     
82        </xsl:for-each>
83    </xsl:template>  
84   
85    <xsl:template match="node()">
86      <xsl:apply-templates/>
87</xsl:template>
88<xsl:for-each select="/creditRisk/pit/score[SPID eq spid]">
89<xsl:for-each select="/creditRisk/pit/score[SPID eq $spid]">
90

Source https://stackoverflow.com/questions/70931597

QUESTION

Foreign key created in shadow and appending random 1 to column name - ASP:NET EF Core

Asked 2022-Jan-16 at 18:33

When I migrate my new models and data I get the following error for multiple foreign keys:

The foreign key property 'InsurancePolicy.InsuranceSubjectID1' was created in shadow state because a conflicting property with the simple name 'InsuranceSubjectID' exists in the entity type, but is either not mapped, is already used for another relationship, or is incompatible with the associated primary key type.

The weird thing is that I define my relationships the same throughout all models, but some work okay (FK without 1 is stored) and some don't.

Example of my models:

1public class InsurancePolicy
2{
3    public int InsurancePolicyID { get; set; }
4    [DataType(DataType.Currency)]
5    [Column(TypeName = "money")]
6    public decimal FinalSum { get; set; }
7    public DateTime DateFrom { get; set; }
8    public DateTime DateTo { get; set; }
9    public int? InsuredID { get; set; }
10    public Insured? Insured { get; set; }
11    public int? InsuranceSubjectID;
12    public InsuranceSubject? InsuranceSubject { get; set; }
13    public int? InsuranceSubtypeID;
14    public InsuranceSubtype? InsuranceSubtype { get; set; }
15}
16
17public class InsuranceSubject
18{
19    public int InsuranceSubjectID { get; set; }
20    [Required]
21    [StringLength(50)]
22    public string Title { get; set; }
23    public string Description { get; set; }
24    [DataType(DataType.Currency)]
25    [Column(TypeName = "money")]
26    public decimal EstimatedValue { get; set; }
27    public int? InsuredID;
28    public Insured? Insured;
29    public int? InsuranceSubjectTypeID { get; set; }
30    public InsuranceSubjectType? InsuranceSubjectType { get; set; }
31    public ICollection<InsurancePolicy>? InsurancePolicies { get; set; }
32}
33

I tried my code without the foreign key properties and only left the reference navigation property (deleted the int and left the object) and it worked okay, but I need FK ints for future implementation.

Here is GitHub repo link for more insight (branch model-extension): https://github.com/lenartgolob/Insurance-IS/tree/model-extension

ANSWER

Answered 2022-Jan-02 at 13:11

I added public virtual in front of my reference navigation properties and it solved the issue.

Source https://stackoverflow.com/questions/70306762

QUESTION

How to collapse the ExpansionTile on button click? - Flutter

Asked 2021-Dec-23 at 11:34

I'm opening up a form to enter the details and close it upon filling everything and submitting it, but only the trailing icon is getting changed, also I'm trying to set the changes in the onExpansionChanged but not reflecting in the UI.

Updated Code

1Scaffold(
2        backgroundColor: Colors.grey.shade200,
3        appBar: AppBar(
4          title: TextButton(
5            child: Text(count.toString()),
6            onPressed: () {
7              Navigator.push(context,
8                  MaterialPageRoute(builder: (_) => RegisterLetterBookedListScreen()));
9            },
10          ),
11          backgroundColor: ColorConstants.kPrimaryColor,
12          elevation: 0,
13        ),
14        floatingActionButton: FloatingActionButton(
15          onPressed: () {
16            MotionToast.success(
17              title: 'Amount to be Collected',
18              titleStyle: TextStyle(fontWeight: FontWeight.bold),
19              description: '\u{20B9} $amountToBeCollected',
20              descriptionStyle: TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
21              layoutOrientation: ORIENTATION.LTR,
22              animationType: ANIMATION.FROM_LEFT,
23              width: 300,
24            ).show(context);
25          },
26          child: Text(
27            '\u{20B9} $amountToBeCollected',
28            style: TextStyle(fontSize: 20),
29          ),
30          shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
31        ),
32        body: Padding(
33          padding: const EdgeInsets.all(20.0),
34          child: SingleChildScrollView(
35            child: Column(
36              crossAxisAlignment: CrossAxisAlignment.start,
37              children: [
38                //Article Details
39                Column(
40                  crossAxisAlignment: CrossAxisAlignment.start,
41                  children: [
42                    
43
44                //Sender Details
45                ExpansionTile(
46                  key: GlobalKey(),
47                  trailing: (senderExpansion == false)
48                      ? Icon(
49                          MdiIcons.toggleSwitchOffOutline,
50                          size: 40,
51                          color: Colors.black54,
52                        )
53                      : Icon(MdiIcons.toggleSwitchOutline, size: 40, color: Colors.red),
54                  onExpansionChanged: (value) {
55                      senderExpansion = value;
56                  },
57                  maintainState: true,
58                  initiallyExpanded: senderExpansion,
59                  title: Text(
60                    'Sender Details',
61                    style: TextStyle(
62                        fontWeight: FontWeight.bold,
63                        color: senderHeadingColor,
64                        fontSize: 20,
65                        letterSpacing: 1),
66                  ),
67                  children: [
68                    Column(
69                      children: [
70                        CInputForm(
71                          readOnly: false,
72                          iconData: Icons.person,
73                          labelText: 'Name *',
74                          controller: senderNameController,
75                          textType: TextInputType.text,
76                          typeValue: 'Name',
77                          focusNode: senderNameFocusNode,
78                        ),
79                        CInputForm(
80                          readOnly: false,
81                          iconData: MdiIcons.home,
82                          labelText: 'Address *',
83                          controller: senderAddressController,
84                          textType: TextInputType.multiline,
85                          typeValue: 'Address',
86                          focusNode: senderAddressFocusNode,
87                        ),
88                        Card(
89                          elevation: 0,
90                          child: TypeAheadFormField(
91                            textFieldConfiguration: TextFieldConfiguration(
92                                style: TextStyle(color: Colors.blueGrey),
93                                controller: senderPinCodeCityController,
94                                autofocus: false,
95                                decoration: InputDecoration(
96                                    prefixIcon: Icon(
97                                      Icons.location_on_outlined,
98                                      color: Colors.blueGrey,
99                                    ),
100                                    fillColor: Colors.white,
101                                    filled: true,
102                                    enabledBorder: OutlineInputBorder(
103                                      borderSide: BorderSide(color: Colors.white),
104                                    ),
105                                    labelText: 'Pincode/Office Name *',
106                                    labelStyle: TextStyle(
107                                        color: ColorConstants.kAmberAccentColor),
108                                    border: OutlineInputBorder(
109                                        borderSide: BorderSide(color: Colors.white)))),
110                            onSuggestionSelected:
111                                (Map<String, String> suggestion) async {
112                              senderPinCodeCityController.text = suggestion['pinCode']!;
113                              senderCityController.text = suggestion['city']!;
114                              senderStateController.text = suggestion['state']!;
115                            },
116                            itemBuilder: (context, Map<String, String> suggestion) {
117                              return ListTile(
118                                title: Text(suggestion['officeName']! +
119                                    ", " +
120                                    suggestion['pinCode']!),
121                              );
122                            },
123                            suggestionsCallback: (pattern) async {
124                              return await FetchPin.getSuggestions(pattern);
125                            },
126                            validator: (value) {
127                              if (value!.isEmpty) {
128                                issPin = false;
129                                isLoading = false;
130                              }
131                            },
132                          ),
133                        ),
134                        Visibility(
135                          visible: issPin == false ? senderPinCodeCityController.text.isEmpty ? true : false : false,
136                          child: Align(
137                              alignment: Alignment.topLeft,
138                              child: Padding(
139                                padding: const EdgeInsets.only(left: 17.0),
140                                child: Text('Select a Pincode/Office name', style: TextStyle(fontSize: 10, color: ColorConstants.kPrimaryColor),),
141                              )),
142                        ),
143                        Visibility(
144                          visible:
145                              senderPinCodeCityController.text.isEmpty ? false : true,
146                          child: CInputForm(
147                            readOnly: true,
148                            iconData: Icons.location_city,
149                            labelText: 'City',
150                            controller: senderCityController,
151                            textType: TextInputType.text,
152                            typeValue: 'City',
153                            focusNode: senderPinCodeFocusNode,
154                          ),
155                        ),
156                        Visibility(
157                          visible:
158                          senderPinCodeCityController.text.isEmpty ? false : true,
159                          child: CInputForm(
160                            readOnly: true,
161                            iconData: Icons.location_city,
162                            labelText: 'State',
163                            controller: senderStateController,
164                            textType: TextInputType.text,
165                            typeValue: 'City',
166                            focusNode: senderPinCodeFocusNode,
167                          ),
168                        ),
169                        CInputForm(
170                          readOnly: false,
171                          iconData: MdiIcons.cellphone,
172                          labelText: 'Mobile Number',
173                          controller: senderMobileNumberController,
174                          textType: TextInputType.number,
175                          typeValue: 'MobileNumber',
176                          focusNode: senderMobileFocusNode,
177                        ),
178                        CInputForm(
179                          readOnly: false,
180                          iconData: MdiIcons.email,
181                          labelText: 'Email',
182                          controller: senderEmailController,
183                          textType: TextInputType.emailAddress,
184                          typeValue: 'Email',
185                          focusNode: senderEmailFocusNode,
186                        ),
187                      ],
188                    )
189                  ],
190                ),
191
192                //Addressee Details
193                ExpansionTile(
194                  trailing: (addresseeExpansion == false)
195                      ? Icon(
196                          MdiIcons.toggleSwitchOffOutline,
197                          size: 40,
198                          color: Colors.black54,
199                        )
200                      : Icon(MdiIcons.toggleSwitchOutline, size: 40, color: Colors.red),
201                  onExpansionChanged: (value) {
202                      addresseeExpansion = value;
203                  },
204                  maintainState: true,
205                  title: Text('Addressee Details',
206                      style: TextStyle(
207                          fontWeight: FontWeight.bold,
208                          color: addresseeHeadingColor,
209                          fontSize: 20,
210                          letterSpacing: 1)),
211                  children: [
212                    Column(
213                      children: [
214                        CInputForm(
215                          readOnly: false,
216                          iconData: Icons.person,
217                          labelText: 'Name *',
218                          controller: addresseeNameController,
219                          textType: TextInputType.text,
220                          typeValue: 'Name',
221                          focusNode: addresseeNameFocusNode,
222                        ),
223                        CInputForm(
224                          readOnly: false,
225                          iconData: MdiIcons.home,
226                          labelText: 'Address *',
227                          controller: addresseeAddressController,
228                          textType: TextInputType.multiline,
229                          typeValue: 'Address',
230                          focusNode: addresseeAddressFocusNode,
231                        ),
232                        Card(
233                          elevation: 0,
234                          child: TypeAheadFormField(
235                            textFieldConfiguration: TextFieldConfiguration(
236                                style: TextStyle(color: Colors.blueGrey),
237                                controller: addresseePinCodeCityController,
238                                autofocus: false,
239                                decoration: InputDecoration(
240                                    prefixIcon: Icon(
241                                      Icons.location_on_outlined,
242                                      color: Colors.blueGrey,
243                                    ),
244                                    fillColor: Colors.white,
245                                    filled: true,
246                                    enabledBorder: OutlineInputBorder(
247                                      borderSide: BorderSide(color: Colors.white),
248                                    ),
249                                    labelText: 'Pincode/Office Name *',
250                                    labelStyle: TextStyle(
251                                        color: ColorConstants.kAmberAccentColor),
252                                    border: OutlineInputBorder(
253                                        borderSide: BorderSide(color: Colors.white)))),
254                            onSuggestionSelected:
255                                (Map<String, String> suggestion) async {
256                              addresseePinCodeCityController.text =
257                                  suggestion['pinCode']!;
258                              addresseeCityController.text = suggestion['city']!;
259                              addresseeStateController.text = suggestion['state']!;
260                            },
261                            itemBuilder: (context, Map<String, String> suggestion) {
262                              return ListTile(
263                                title: Text(suggestion['officeName']! +
264                                    ", " +
265                                    suggestion['pinCode']!),
266                              );
267                            },
268                            suggestionsCallback: (pattern) async {
269                              return await FetchPin.getSuggestions(pattern);
270                            },
271                            validator: (value) {
272                              if (value!.isEmpty) {
273                                isLoading = false;
274                                isaPin = false;
275
276                              }
277                            },
278                          ),
279                        ),
280                        Visibility(
281                          visible: isaPin == false ? addresseePinCodeCityController.text.isEmpty ? true : false : false,
282                          child: Align(
283                              alignment: Alignment.topLeft,
284                              child: Padding(
285                                padding: const EdgeInsets.only(left: 17.0),
286                                child: Text('Select a Pincode/Office name', style: TextStyle(fontSize: 10, color: ColorConstants.kPrimaryColor),),
287                              )),
288                        ),
289                        Visibility(
290                          visible: addresseePinCodeCityController.text.isEmpty
291                              ? false
292                              : true,
293                          child: CInputForm(
294                            readOnly: true,
295                            iconData: Icons.location_city,
296                            labelText: 'City',
297                            controller: addresseeCityController,
298                            textType: TextInputType.text,
299                            typeValue: 'City',
300                            focusNode: addresseePinCodeFocusNode,
301                          ),
302                        ),
303                        Visibility(
304                          visible: addresseePinCodeCityController.text.isEmpty
305                              ? false
306                              : true,
307                          child: CInputForm(
308                            readOnly: true,
309                            iconData: Icons.location_city,
310                            labelText: 'State',
311                            controller: addresseeStateController,
312                            textType: TextInputType.text,
313                            typeValue: 'State',
314                            focusNode: addresseePinCodeFocusNode,
315                          ),
316                        ),
317                        CInputForm(
318                          readOnly: false,
319                          iconData: MdiIcons.cellphone,
320                          labelText: 'Mobile Number',
321                          controller: addresseeMobileNumberController,
322                          textType: TextInputType.number,
323                          typeValue: 'MobileNumber',
324                          focusNode: addresseeMobileFocusNode,
325                        ),
326                        CInputForm(
327                          readOnly: false,
328                          iconData: MdiIcons.email,
329                          labelText: 'Email',
330                          controller: addresseeEmailController,
331                          textType: TextInputType.emailAddress,
332                          typeValue: 'Email',
333                          focusNode: addresseeEmailFocusNode,
334                        ),
335                      ],
336                    ),
337                  ],
338                ),
339
340                //Submit
341                Padding(
342                  padding: const EdgeInsets.all(8.0),
343                  child: Center(
344                    child: ElevatedButton(
345                      style: ButtonStyle(
346                          backgroundColor:
347                              MaterialStateProperty.all<Color>(Colors.white),
348                          shape: MaterialStateProperty.all<RoundedRectangleBorder>(
349                              RoundedRectangleBorder(
350                                  borderRadius: BorderRadius.circular(10),
351                                  side: BorderSide(color: Colors.blueGrey)))),
352                      onPressed: () async {
353                        setState(() {
354                          senderExpansion = !senderExpansion;
355                          addresseeExpansion = !addresseeExpansion;
356                        });
357                        final ifPresent = await RegisterLetterTable()
358                            .select()
359                            .ArticleNumber
360                            .equals(articleNumberController.text)
361                            .toMapList();
362                        if (ifPresent.isNotEmpty) {
363                          ScaffoldMessenger.of(context).showSnackBar(SnackBar(
364                            content: Text('Article already scanned'),
365                            behavior: SnackBarBehavior.floating,
366                          ));
367                        } else {
368                          if (articleNumberController.text.isEmpty) {
369                            setState(() {
370                              articleNumberFocusNode.requestFocus();
371                            });
372                          } else if (weightController.text.isEmpty) {
373                            setState(() {
374                              weightFocusNode.requestFocus();
375                            });
376                          } else if (insuranceCheck == true) {
377                            if (insuranceController.text.isEmpty)
378                              insuranceFocusNode.requestFocus();
379                          } else if (valuePayableCheck == true) {
380                            if (valuePayablePostController.text.isEmpty)
381                              valuePayableFocusNode.requestFocus();
382                          }
383
384                          if (senderNameController.text.isEmpty ||
385                              senderAddressController.text.isEmpty ||
386                              senderPinCodeCityController.text.isEmpty) {
387                            setState(() {
388                              senderExpansion = true;
389                            });
390                            if (addresseeNameController.text.isEmpty ||
391                                addresseeAddressController.text.isEmpty ||
392                                addresseePinCodeCityController.text.isEmpty) {
393                              setState(() {
394                                addresseeExpansion = true;
395                              });
396                            } else
397                              setState(() {
398                                addresseeExpansion = false;
399                              });
400                          } else
401                            senderExpansion = false;
402                          if (addresseeNameController.text.isEmpty ||
403                              addresseeAddressController.text.isEmpty ||
404                              addresseePinCodeCityController.text.isEmpty) {
405                            setState(() {
406                              addresseeExpansion = true;
407                            });
408                          } else
409                            setState(() {
410                              addresseeExpansion = false;
411                            });
412
413                          if (formGlobalKey.currentState!.validate()) {
414                            formGlobalKey.currentState!.save();
415
416                            showDialog<void>(
417                                context: context,
418                                barrierDismissible: false,
419                                builder: (BuildContext context) {
420                                  return ConformationDialog(
421                                      articleNumber: articleNumberController.text,
422                                      weight: weightController.text,
423                                      prepaidAmount: prepaidAmountController.text,
424                                      acknowledgement: acknowledgementCheck,
425                                      insurance: insuranceCheck == true
426                                          ? insuranceController.text
427                                          : '',
428                                      valuePayablePost: valuePayableCheck == true
429                                          ? valuePayablePostController.text
430                                          : '',
431                                      amountToBeCollected:
432                                          amountToBeCollectedController.text,
433                                      senderName: senderNameController.text,
434                                      senderAddress: senderAddressController.text,
435                                      senderPinCode: senderPinCodeCityController.text,
436                                      senderCity: senderCityController.text,
437                                      senderState: senderStateController.text,
438                                      senderMobileNumber:
439                                          senderMobileNumberController.text,
440                                      senderEmail: senderEmailController.text,
441                                      addresseeName: addresseeNameController.text,
442                                      addresseeAddress: addresseeAddressController.text,
443                                      addresseePinCode:
444                                          addresseePinCodeCityController.text,
445                                      addresseeCity: addresseeCityController.text,
446                                      addresseeState: addresseeStateController.text,
447                                      addresseeMobileNumber:
448                                          addresseeMobileNumberController.text,
449                                      addresseeEmail: addresseeEmailController.text,
450                                      function: () {
451                                        Navigator.of(context).pop();
452                                        printFunction();
453                                      });
454                                });
455                          }
456                        }
457                      },
458                      child: Padding(
459                        padding: const EdgeInsets.all(8.0),
460                        child: new Text(
461                          'SUBMIT',
462                          overflow: TextOverflow.ellipsis,
463                          style: TextStyle(color: ColorConstants.kAmberAccentColor),
464                        ),
465                      ),
466                    ),
467                  ),
468                )
469              ],
470            ),
471          ),
472        ))
473

ANSWER

Answered 2021-Dec-21 at 12:01

checkout below code it may help you,

1Scaffold(
2        backgroundColor: Colors.grey.shade200,
3        appBar: AppBar(
4          title: TextButton(
5            child: Text(count.toString()),
6            onPressed: () {
7              Navigator.push(context,
8                  MaterialPageRoute(builder: (_) => RegisterLetterBookedListScreen()));
9            },
10          ),
11          backgroundColor: ColorConstants.kPrimaryColor,
12          elevation: 0,
13        ),
14        floatingActionButton: FloatingActionButton(
15          onPressed: () {
16            MotionToast.success(
17              title: 'Amount to be Collected',
18              titleStyle: TextStyle(fontWeight: FontWeight.bold),
19              description: '\u{20B9} $amountToBeCollected',
20              descriptionStyle: TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
21              layoutOrientation: ORIENTATION.LTR,
22              animationType: ANIMATION.FROM_LEFT,
23              width: 300,
24            ).show(context);
25          },
26          child: Text(
27            '\u{20B9} $amountToBeCollected',
28            style: TextStyle(fontSize: 20),
29          ),
30          shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
31        ),
32        body: Padding(
33          padding: const EdgeInsets.all(20.0),
34          child: SingleChildScrollView(
35            child: Column(
36              crossAxisAlignment: CrossAxisAlignment.start,
37              children: [
38                //Article Details
39                Column(
40                  crossAxisAlignment: CrossAxisAlignment.start,
41                  children: [
42                    
43
44                //Sender Details
45                ExpansionTile(
46                  key: GlobalKey(),
47                  trailing: (senderExpansion == false)
48                      ? Icon(
49                          MdiIcons.toggleSwitchOffOutline,
50                          size: 40,
51                          color: Colors.black54,
52                        )
53                      : Icon(MdiIcons.toggleSwitchOutline, size: 40, color: Colors.red),
54                  onExpansionChanged: (value) {
55                      senderExpansion = value;
56                  },
57                  maintainState: true,
58                  initiallyExpanded: senderExpansion,
59                  title: Text(
60                    'Sender Details',
61                    style: TextStyle(
62                        fontWeight: FontWeight.bold,
63                        color: senderHeadingColor,
64                        fontSize: 20,
65                        letterSpacing: 1),
66                  ),
67                  children: [
68                    Column(
69                      children: [
70                        CInputForm(
71                          readOnly: false,
72                          iconData: Icons.person,
73                          labelText: 'Name *',
74                          controller: senderNameController,
75                          textType: TextInputType.text,
76                          typeValue: 'Name',
77                          focusNode: senderNameFocusNode,
78                        ),
79                        CInputForm(
80                          readOnly: false,
81                          iconData: MdiIcons.home,
82                          labelText: 'Address *',
83                          controller: senderAddressController,
84                          textType: TextInputType.multiline,
85                          typeValue: 'Address',
86                          focusNode: senderAddressFocusNode,
87                        ),
88                        Card(
89                          elevation: 0,
90                          child: TypeAheadFormField(
91                            textFieldConfiguration: TextFieldConfiguration(
92                                style: TextStyle(color: Colors.blueGrey),
93                                controller: senderPinCodeCityController,
94                                autofocus: false,
95                                decoration: InputDecoration(
96                                    prefixIcon: Icon(
97                                      Icons.location_on_outlined,
98                                      color: Colors.blueGrey,
99                                    ),
100                                    fillColor: Colors.white,
101                                    filled: true,
102                                    enabledBorder: OutlineInputBorder(
103                                      borderSide: BorderSide(color: Colors.white),
104                                    ),
105                                    labelText: 'Pincode/Office Name *',
106                                    labelStyle: TextStyle(
107                                        color: ColorConstants.kAmberAccentColor),
108                                    border: OutlineInputBorder(
109                                        borderSide: BorderSide(color: Colors.white)))),
110                            onSuggestionSelected:
111                                (Map<String, String> suggestion) async {
112                              senderPinCodeCityController.text = suggestion['pinCode']!;
113                              senderCityController.text = suggestion['city']!;
114                              senderStateController.text = suggestion['state']!;
115                            },
116                            itemBuilder: (context, Map<String, String> suggestion) {
117                              return ListTile(
118                                title: Text(suggestion['officeName']! +
119                                    ", " +
120                                    suggestion['pinCode']!),
121                              );
122                            },
123                            suggestionsCallback: (pattern) async {
124                              return await FetchPin.getSuggestions(pattern);
125                            },
126                            validator: (value) {
127                              if (value!.isEmpty) {
128                                issPin = false;
129                                isLoading = false;
130                              }
131                            },
132                          ),
133                        ),
134                        Visibility(
135                          visible: issPin == false ? senderPinCodeCityController.text.isEmpty ? true : false : false,
136                          child: Align(
137                              alignment: Alignment.topLeft,
138                              child: Padding(
139                                padding: const EdgeInsets.only(left: 17.0),
140                                child: Text('Select a Pincode/Office name', style: TextStyle(fontSize: 10, color: ColorConstants.kPrimaryColor),),
141                              )),
142                        ),
143                        Visibility(
144                          visible:
145                              senderPinCodeCityController.text.isEmpty ? false : true,
146                          child: CInputForm(
147                            readOnly: true,
148                            iconData: Icons.location_city,
149                            labelText: 'City',
150                            controller: senderCityController,
151                            textType: TextInputType.text,
152                            typeValue: 'City',
153                            focusNode: senderPinCodeFocusNode,
154                          ),
155                        ),
156                        Visibility(
157                          visible:
158                          senderPinCodeCityController.text.isEmpty ? false : true,
159                          child: CInputForm(
160                            readOnly: true,
161                            iconData: Icons.location_city,
162                            labelText: 'State',
163                            controller: senderStateController,
164                            textType: TextInputType.text,
165                            typeValue: 'City',
166                            focusNode: senderPinCodeFocusNode,
167                          ),
168                        ),
169                        CInputForm(
170                          readOnly: false,
171                          iconData: MdiIcons.cellphone,
172                          labelText: 'Mobile Number',
173                          controller: senderMobileNumberController,
174                          textType: TextInputType.number,
175                          typeValue: 'MobileNumber',
176                          focusNode: senderMobileFocusNode,
177                        ),
178                        CInputForm(
179                          readOnly: false,
180                          iconData: MdiIcons.email,
181                          labelText: 'Email',
182                          controller: senderEmailController,
183                          textType: TextInputType.emailAddress,
184                          typeValue: 'Email',
185                          focusNode: senderEmailFocusNode,
186                        ),
187                      ],
188                    )
189                  ],
190                ),
191
192                //Addressee Details
193                ExpansionTile(
194                  trailing: (addresseeExpansion == false)
195                      ? Icon(
196                          MdiIcons.toggleSwitchOffOutline,
197                          size: 40,
198                          color: Colors.black54,
199                        )
200                      : Icon(MdiIcons.toggleSwitchOutline, size: 40, color: Colors.red),
201                  onExpansionChanged: (value) {
202                      addresseeExpansion = value;
203                  },
204                  maintainState: true,
205                  title: Text('Addressee Details',
206                      style: TextStyle(
207                          fontWeight: FontWeight.bold,
208                          color: addresseeHeadingColor,
209                          fontSize: 20,
210                          letterSpacing: 1)),
211                  children: [
212                    Column(
213                      children: [
214                        CInputForm(
215                          readOnly: false,
216                          iconData: Icons.person,
217                          labelText: 'Name *',
218                          controller: addresseeNameController,
219                          textType: TextInputType.text,
220                          typeValue: 'Name',
221                          focusNode: addresseeNameFocusNode,
222                        ),
223                        CInputForm(
224                          readOnly: false,
225                          iconData: MdiIcons.home,
226                          labelText: 'Address *',
227                          controller: addresseeAddressController,
228                          textType: TextInputType.multiline,
229                          typeValue: 'Address',
230                          focusNode: addresseeAddressFocusNode,
231                        ),
232                        Card(
233                          elevation: 0,
234                          child: TypeAheadFormField(
235                            textFieldConfiguration: TextFieldConfiguration(
236                                style: TextStyle(color: Colors.blueGrey),
237                                controller: addresseePinCodeCityController,
238                                autofocus: false,
239                                decoration: InputDecoration(
240                                    prefixIcon: Icon(
241                                      Icons.location_on_outlined,
242                                      color: Colors.blueGrey,
243                                    ),
244                                    fillColor: Colors.white,
245                                    filled: true,
246                                    enabledBorder: OutlineInputBorder(
247                                      borderSide: BorderSide(color: Colors.white),
248                                    ),
249                                    labelText: 'Pincode/Office Name *',
250                                    labelStyle: TextStyle(
251                                        color: ColorConstants.kAmberAccentColor),
252                                    border: OutlineInputBorder(
253                                        borderSide: BorderSide(color: Colors.white)))),
254                            onSuggestionSelected:
255                                (Map<String, String> suggestion) async {
256                              addresseePinCodeCityController.text =
257                                  suggestion['pinCode']!;
258                              addresseeCityController.text = suggestion['city']!;
259                              addresseeStateController.text = suggestion['state']!;
260                            },
261                            itemBuilder: (context, Map<String, String> suggestion) {
262                              return ListTile(
263                                title: Text(suggestion['officeName']! +
264                                    ", " +
265                                    suggestion['pinCode']!),
266                              );
267                            },
268                            suggestionsCallback: (pattern) async {
269                              return await FetchPin.getSuggestions(pattern);
270                            },
271                            validator: (value) {
272                              if (value!.isEmpty) {
273                                isLoading = false;
274                                isaPin = false;
275
276                              }
277                            },
278                          ),
279                        ),
280                        Visibility(
281                          visible: isaPin == false ? addresseePinCodeCityController.text.isEmpty ? true : false : false,
282                          child: Align(
283                              alignment: Alignment.topLeft,
284                              child: Padding(
285                                padding: const EdgeInsets.only(left: 17.0),
286                                child: Text('Select a Pincode/Office name', style: TextStyle(fontSize: 10, color: ColorConstants.kPrimaryColor),),
287                              )),
288                        ),
289                        Visibility(
290                          visible: addresseePinCodeCityController.text.isEmpty
291                              ? false
292                              : true,
293                          child: CInputForm(
294                            readOnly: true,
295                            iconData: Icons.location_city,
296                            labelText: 'City',
297                            controller: addresseeCityController,
298                            textType: TextInputType.text,
299                            typeValue: 'City',
300                            focusNode: addresseePinCodeFocusNode,
301                          ),
302                        ),
303                        Visibility(
304                          visible: addresseePinCodeCityController.text.isEmpty
305                              ? false
306                              : true,
307                          child: CInputForm(
308                            readOnly: true,
309                            iconData: Icons.location_city,
310                            labelText: 'State',
311                            controller: addresseeStateController,
312                            textType: TextInputType.text,
313                            typeValue: 'State',
314                            focusNode: addresseePinCodeFocusNode,
315                          ),
316                        ),
317                        CInputForm(
318                          readOnly: false,
319                          iconData: MdiIcons.cellphone,
320                          labelText: 'Mobile Number',
321                          controller: addresseeMobileNumberController,
322                          textType: TextInputType.number,
323                          typeValue: 'MobileNumber',
324                          focusNode: addresseeMobileFocusNode,
325                        ),
326                        CInputForm(
327                          readOnly: false,
328                          iconData: MdiIcons.email,
329                          labelText: 'Email',
330                          controller: addresseeEmailController,
331                          textType: TextInputType.emailAddress,
332                          typeValue: 'Email',
333                          focusNode: addresseeEmailFocusNode,
334                        ),
335                      ],
336                    ),
337                  ],
338                ),
339
340                //Submit
341                Padding(
342                  padding: const EdgeInsets.all(8.0),
343                  child: Center(
344                    child: ElevatedButton(
345                      style: ButtonStyle(
346                          backgroundColor:
347                              MaterialStateProperty.all<Color>(Colors.white),
348                          shape: MaterialStateProperty.all<RoundedRectangleBorder>(
349                              RoundedRectangleBorder(
350                                  borderRadius: BorderRadius.circular(10),
351                                  side: BorderSide(color: Colors.blueGrey)))),
352                      onPressed: () async {
353                        setState(() {
354                          senderExpansion = !senderExpansion;
355                          addresseeExpansion = !addresseeExpansion;
356                        });
357                        final ifPresent = await RegisterLetterTable()
358                            .select()
359                            .ArticleNumber
360                            .equals(articleNumberController.text)
361                            .toMapList();
362                        if (ifPresent.isNotEmpty) {
363                          ScaffoldMessenger.of(context).showSnackBar(SnackBar(
364                            content: Text('Article already scanned'),
365                            behavior: SnackBarBehavior.floating,
366                          ));
367                        } else {
368                          if (articleNumberController.text.isEmpty) {
369                            setState(() {
370                              articleNumberFocusNode.requestFocus();
371                            });
372                          } else if (weightController.text.isEmpty) {
373                            setState(() {
374                              weightFocusNode.requestFocus();
375                            });
376                          } else if (insuranceCheck == true) {
377                            if (insuranceController.text.isEmpty)
378                              insuranceFocusNode.requestFocus();
379                          } else if (valuePayableCheck == true) {
380                            if (valuePayablePostController.text.isEmpty)
381                              valuePayableFocusNode.requestFocus();
382                          }
383
384                          if (senderNameController.text.isEmpty ||
385                              senderAddressController.text.isEmpty ||
386                              senderPinCodeCityController.text.isEmpty) {
387                            setState(() {
388                              senderExpansion = true;
389                            });
390                            if (addresseeNameController.text.isEmpty ||
391                                addresseeAddressController.text.isEmpty ||
392                                addresseePinCodeCityController.text.isEmpty) {
393                              setState(() {
394                                addresseeExpansion = true;
395                              });
396                            } else
397                              setState(() {
398                                addresseeExpansion = false;
399                              });
400                          } else
401                            senderExpansion = false;
402                          if (addresseeNameController.text.isEmpty ||
403                              addresseeAddressController.text.isEmpty ||
404                              addresseePinCodeCityController.text.isEmpty) {
405                            setState(() {
406                              addresseeExpansion = true;
407                            });
408                          } else
409                            setState(() {
410                              addresseeExpansion = false;
411                            });
412
413                          if (formGlobalKey.currentState!.validate()) {
414                            formGlobalKey.currentState!.save();
415
416                            showDialog<void>(
417                                context: context,
418                                barrierDismissible: false,
419                                builder: (BuildContext context) {
420                                  return ConformationDialog(
421                                      articleNumber: articleNumberController.text,
422                                      weight: weightController.text,
423                                      prepaidAmount: prepaidAmountController.text,
424                                      acknowledgement: acknowledgementCheck,
425                                      insurance: insuranceCheck == true
426                                          ? insuranceController.text
427                                          : '',
428                                      valuePayablePost: valuePayableCheck == true
429                                          ? valuePayablePostController.text
430                                          : '',
431                                      amountToBeCollected:
432                                          amountToBeCollectedController.text,
433                                      senderName: senderNameController.text,
434                                      senderAddress: senderAddressController.text,
435                                      senderPinCode: senderPinCodeCityController.text,
436                                      senderCity: senderCityController.text,
437                                      senderState: senderStateController.text,
438                                      senderMobileNumber:
439                                          senderMobileNumberController.text,
440                                      senderEmail: senderEmailController.text,
441                                      addresseeName: addresseeNameController.text,
442                                      addresseeAddress: addresseeAddressController.text,
443                                      addresseePinCode:
444                                          addresseePinCodeCityController.text,
445                                      addresseeCity: addresseeCityController.text,
446                                      addresseeState: addresseeStateController.text,
447                                      addresseeMobileNumber:
448                                          addresseeMobileNumberController.text,
449                                      addresseeEmail: addresseeEmailController.text,
450                                      function: () {
451                                        Navigator.of(context).pop();
452                                        printFunction();
453                                      });
454                                });
455                          }
456                        }
457                      },
458                      child: Padding(
459                        padding: const EdgeInsets.all(8.0),
460                        child: new Text(
461                          'SUBMIT',
462                          overflow: TextOverflow.ellipsis,
463                          style: TextStyle(color: ColorConstants.kAmberAccentColor),
464                        ),
465                      ),
466                    ),
467                  ),
468                )
469              ],
470            ),
471          ),
472        ))
473class TestExpanTile extends StatefulWidget {
474  @override
475  TestExpanTileState createState() => new TestExpanTileState();
476}
477
478class TestExpanTileState extends State<TestExpanTile> {
479
480  String senderDet = 'Sender Details ';
481  bool formOpenFlag = true;
482
483  @override
484  Widget build(BuildContext context) {
485    return new MaterialApp(
486      home: new Scaffold(
487        appBar: new AppBar(
488          title: const Text('ExpansionTile'),
489        ),
490        body: new ExpansionTile(
491          key: GlobalKey(),
492          initiallyExpanded: formOpenFlag,
493          onExpansionChanged: (val) {
494            formOpenFlag = val; // update here on change
495          },
496          title: new Text(this.senderDet),
497          backgroundColor: Theme.of(context).accentColor.withOpacity(0.025),
498          children: <Widget>[
499            new ListTile(
500              title: const Text('Your Filling Form goes here'),
501              onTap: () {},
502            ),
503            RaisedButton(
504              onPressed: () {
505                setState(() {
506                  formOpenFlag = !formOpenFlag;
507                });
508              },
509              child: Text("Close Tile On Submit"),
510            )
511          ],
512        ),
513      ),
514    );
515  }
516}
517
518

Source https://stackoverflow.com/questions/70434902

QUESTION

I have a dataset in which i have two columns with time in it but the dat

Asked 2021-Dec-22 at 17:00
1Unnamed: 0     Created Date             Closed Date            Agency   Agency Name  Complaint Type Descriptor  Location Type   Incident Zip    Address Type    City    Landmark    Status  Borough
22869    2869    10/30/2013 09:14:47 AM  10/30/2013 10:48:51 AM  NYPD    New York City Police Department Illegal Parking Double Parked Blocking Traffic  Street/Sidewalk 11217.0 PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
323571   23571   10/25/2013 02:33:54 PM  10/25/2013 03:36:36 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
441625   41625   10/22/2013 09:33:56 PM  10/24/2013 05:37:24 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
544331   44331   10/22/2013 07:25:35 AM  10/25/2013 10:40:35 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
646913   46913   10/21/2013 05:03:26 PM  10/23/2013 09:59:23 AM  DPR Department of Parks and Recreation  Dead Tree   Dead/Dying Tree Street  11215   PLACENAME   BROOKLYN    BARTEL PRITCHARD SQUARE Closed  BROOKLYN
747459   47459   10/21/2013 02:56:08 PM  10/29/2013 06:17:10 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10031   PLACENAME   NEW YORK    CITY COLLEGE    Closed  MANHATTAN
848465   48465   10/21/2013 10:44:10 AM  10/21/2013 11:17:47 AM  NYPD    New York City Police Department Illegal Parking Posted Parking Sign Violation   Street/Sidewalk 11434   PLACENAME   JAMAICA PS 37   Closed  QUEENS
951837   51837   10/20/2013 04:36:12 PM  10/20/2013 06:35:49 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1051848   51848   10/20/2013 04:26:03 PM  10/20/2013 06:34:47 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1154089   54089   10/19/2013 03:45:47 PM  10/19/2013 04:10:11 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
1254343   54343   10/19/2013 01:27:43 PM  10/28/2013 08:42:12 AM  DOT Department of Transportation    Street Condition    Rough, Pitted or Cracked Roads  Street  10003.0 PLACENAME   NEW YORK    UNION SQUARE PARK   Closed  MANHATTAN
1355140   55140   10/19/2013 02:02:28 AM  10/19/2013 02:19:55 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368.0 PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
1457789   57789   10/18/2013 11:55:44 AM  10/23/2013 02:42:14 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1563119   63119   10/17/2013 06:52:37 AM  10/25/2013 06:49:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
1666242   66242   10/16/2013 01:56:24 PM  10/22/2013 03:09:11 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1766758   66758   10/16/2013 11:52:43 AM  10/16/2013 04:35:34 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
1866786   66786   10/16/2013 11:42:23 AM  10/18/2013 04:57:04 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Insurance Information Requested Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
1966809   66809   10/16/2013 11:36:54 AM  10/16/2013 12:34:23 PM  NYPD    New York City Police Department Traffic Congestion/Gridlock Street/Sidewalk 11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
2067465   67465   10/16/2013 09:14:35 AM  10/16/2013 12:43:06 PM  NYPD    New York City Police Department Traffic Drag Racing Street/Sidewalk 11367   PLACENAME   FLUSHING    QUEENS COLLEGE  Closed  QUEENS
2172424   72424   10/15/2013 12:22:00 AM  10/21/2013 12:16:15 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2275531   75531   10/14/2013 10:59:20 AM  10/14/2013 03:09:51 PM  NYPD    New York City Police Department Vending In Prohibited Area  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2377918   77918   10/13/2013 03:16:03 PM  10/13/2013 03:25:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2478048   78048   10/13/2013 01:06:02 PM  10/21/2013 10:20:21 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
2578352   78352   10/13/2013 05:14:33 AM  10/16/2013 01:42:42 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2678383   78383   10/13/2013 03:50:02 AM  10/13/2013 05:03:13 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368   PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
2779078   79078   10/12/2013 09:53:17 PM  10/13/2013 02:52:07 AM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10011   PLACENAME   NEW YORK    WASHINGTON SQUARE PARK  Closed  MANHATTAN
2884489   84489   10/10/2013 07:16:16 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
2984518   84518   10/10/2013 07:02:29 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3084688   84688   10/10/2013 05:39:19 PM  10/10/2013 10:29:17 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3184695   84695   10/10/2013 05:37:04 PM  10/10/2013 10:30:19 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3288812   88812   10/09/2013 09:17:15 PM  10/23/2013 02:15:21 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3389205   89205   10/09/2013 06:01:48 PM  10/09/2013 09:04:26 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
3489382   89382   10/09/2013 04:53:01 PM  10/18/2013 08:35:02 AM  DOT Department of Transportation    Public Toilet   Damaged Door    Sidewalk    11238   PLACENAME   BROOKLYN    GRAND ARMY PLAZA    Closed  BROOKLYN
3589734   89734   10/09/2013 03:13:23 PM  10/09/2013 05:10:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
3693990   93990   10/08/2013 06:14:15 PM  10/09/2013 04:00:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
3799407   99407   10/07/2013 03:56:11 PM  10/08/2013 07:04:14 AM  DPR Department of Parks and Recreation  Overgrown Tree/Branches Traffic Sign or Signal Blocked  Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3899847   99847   10/07/2013 02:33:21 PM  10/09/2013 02:36:42 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10036.0 PLACENAME   NEW YORK    PORT AUTH 42 STREET Closed  MANHATTAN
39100073  100073  10/07/2013 01:36:02 PM  10/09/2013 09:56:55 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10024.0 PLACENAME   NEW YORK    MUSEUM NATURAL HIST Closed  MANHATTAN
40101013  101013  10/07/2013 10:05:18 AM  10/09/2013 03:36:23 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10017.0 PLACENAME   NEW YORK    GRAND CENTRAL TERM  Closed  MANHATTAN
41104020  104020  10/06/2013 02:58:47 PM  10/07/2013 12:11:16 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430.0 PLACENAME   JAMAICA JFK Closed  QUEENS
42106118  106118  10/05/2013 03:24:47 PM  10/05/2013 04:20:34 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
43106499  106499  10/05/2013 11:52:13 AM  10/07/2013 08:00:28 AM  DOT Department of Transportation    Public Toilet   Dirty/Graffiti  Sidewalk    11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
44

this is how my data looks like. What I want to do here is to extract date from created date and closed date I have tried .extract method but I am new to this so, it didn't work. I want to calculate housrs from created date and closed which i can do like this:

1Unnamed: 0     Created Date             Closed Date            Agency   Agency Name  Complaint Type Descriptor  Location Type   Incident Zip    Address Type    City    Landmark    Status  Borough
22869    2869    10/30/2013 09:14:47 AM  10/30/2013 10:48:51 AM  NYPD    New York City Police Department Illegal Parking Double Parked Blocking Traffic  Street/Sidewalk 11217.0 PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
323571   23571   10/25/2013 02:33:54 PM  10/25/2013 03:36:36 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
441625   41625   10/22/2013 09:33:56 PM  10/24/2013 05:37:24 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
544331   44331   10/22/2013 07:25:35 AM  10/25/2013 10:40:35 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
646913   46913   10/21/2013 05:03:26 PM  10/23/2013 09:59:23 AM  DPR Department of Parks and Recreation  Dead Tree   Dead/Dying Tree Street  11215   PLACENAME   BROOKLYN    BARTEL PRITCHARD SQUARE Closed  BROOKLYN
747459   47459   10/21/2013 02:56:08 PM  10/29/2013 06:17:10 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10031   PLACENAME   NEW YORK    CITY COLLEGE    Closed  MANHATTAN
848465   48465   10/21/2013 10:44:10 AM  10/21/2013 11:17:47 AM  NYPD    New York City Police Department Illegal Parking Posted Parking Sign Violation   Street/Sidewalk 11434   PLACENAME   JAMAICA PS 37   Closed  QUEENS
951837   51837   10/20/2013 04:36:12 PM  10/20/2013 06:35:49 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1051848   51848   10/20/2013 04:26:03 PM  10/20/2013 06:34:47 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1154089   54089   10/19/2013 03:45:47 PM  10/19/2013 04:10:11 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
1254343   54343   10/19/2013 01:27:43 PM  10/28/2013 08:42:12 AM  DOT Department of Transportation    Street Condition    Rough, Pitted or Cracked Roads  Street  10003.0 PLACENAME   NEW YORK    UNION SQUARE PARK   Closed  MANHATTAN
1355140   55140   10/19/2013 02:02:28 AM  10/19/2013 02:19:55 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368.0 PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
1457789   57789   10/18/2013 11:55:44 AM  10/23/2013 02:42:14 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1563119   63119   10/17/2013 06:52:37 AM  10/25/2013 06:49:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
1666242   66242   10/16/2013 01:56:24 PM  10/22/2013 03:09:11 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1766758   66758   10/16/2013 11:52:43 AM  10/16/2013 04:35:34 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
1866786   66786   10/16/2013 11:42:23 AM  10/18/2013 04:57:04 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Insurance Information Requested Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
1966809   66809   10/16/2013 11:36:54 AM  10/16/2013 12:34:23 PM  NYPD    New York City Police Department Traffic Congestion/Gridlock Street/Sidewalk 11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
2067465   67465   10/16/2013 09:14:35 AM  10/16/2013 12:43:06 PM  NYPD    New York City Police Department Traffic Drag Racing Street/Sidewalk 11367   PLACENAME   FLUSHING    QUEENS COLLEGE  Closed  QUEENS
2172424   72424   10/15/2013 12:22:00 AM  10/21/2013 12:16:15 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2275531   75531   10/14/2013 10:59:20 AM  10/14/2013 03:09:51 PM  NYPD    New York City Police Department Vending In Prohibited Area  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2377918   77918   10/13/2013 03:16:03 PM  10/13/2013 03:25:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2478048   78048   10/13/2013 01:06:02 PM  10/21/2013 10:20:21 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
2578352   78352   10/13/2013 05:14:33 AM  10/16/2013 01:42:42 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2678383   78383   10/13/2013 03:50:02 AM  10/13/2013 05:03:13 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368   PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
2779078   79078   10/12/2013 09:53:17 PM  10/13/2013 02:52:07 AM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10011   PLACENAME   NEW YORK    WASHINGTON SQUARE PARK  Closed  MANHATTAN
2884489   84489   10/10/2013 07:16:16 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
2984518   84518   10/10/2013 07:02:29 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3084688   84688   10/10/2013 05:39:19 PM  10/10/2013 10:29:17 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3184695   84695   10/10/2013 05:37:04 PM  10/10/2013 10:30:19 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3288812   88812   10/09/2013 09:17:15 PM  10/23/2013 02:15:21 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3389205   89205   10/09/2013 06:01:48 PM  10/09/2013 09:04:26 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
3489382   89382   10/09/2013 04:53:01 PM  10/18/2013 08:35:02 AM  DOT Department of Transportation    Public Toilet   Damaged Door    Sidewalk    11238   PLACENAME   BROOKLYN    GRAND ARMY PLAZA    Closed  BROOKLYN
3589734   89734   10/09/2013 03:13:23 PM  10/09/2013 05:10:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
3693990   93990   10/08/2013 06:14:15 PM  10/09/2013 04:00:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
3799407   99407   10/07/2013 03:56:11 PM  10/08/2013 07:04:14 AM  DPR Department of Parks and Recreation  Overgrown Tree/Branches Traffic Sign or Signal Blocked  Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3899847   99847   10/07/2013 02:33:21 PM  10/09/2013 02:36:42 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10036.0 PLACENAME   NEW YORK    PORT AUTH 42 STREET Closed  MANHATTAN
39100073  100073  10/07/2013 01:36:02 PM  10/09/2013 09:56:55 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10024.0 PLACENAME   NEW YORK    MUSEUM NATURAL HIST Closed  MANHATTAN
40101013  101013  10/07/2013 10:05:18 AM  10/09/2013 03:36:23 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10017.0 PLACENAME   NEW YORK    GRAND CENTRAL TERM  Closed  MANHATTAN
41104020  104020  10/06/2013 02:58:47 PM  10/07/2013 12:11:16 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430.0 PLACENAME   JAMAICA JFK Closed  QUEENS
42106118  106118  10/05/2013 03:24:47 PM  10/05/2013 04:20:34 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
43106499  106499  10/05/2013 11:52:13 AM  10/07/2013 08:00:28 AM  DOT Department of Transportation    Public Toilet   Dirty/Graffiti  Sidewalk    11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
44pd.Timedelta(task3['Closed Date'] - task3['Created Date']).seconds / 60.0
45

In the end I want the output Find average completion time in hours for top-10 most frequent complaints. Also calculate how many data points you have for each complaint types. Do this analysis only for closed complaints. The sample output I want is as follows:

1Unnamed: 0     Created Date             Closed Date            Agency   Agency Name  Complaint Type Descriptor  Location Type   Incident Zip    Address Type    City    Landmark    Status  Borough
22869    2869    10/30/2013 09:14:47 AM  10/30/2013 10:48:51 AM  NYPD    New York City Police Department Illegal Parking Double Parked Blocking Traffic  Street/Sidewalk 11217.0 PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
323571   23571   10/25/2013 02:33:54 PM  10/25/2013 03:36:36 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
441625   41625   10/22/2013 09:33:56 PM  10/24/2013 05:37:24 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
544331   44331   10/22/2013 07:25:35 AM  10/25/2013 10:40:35 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
646913   46913   10/21/2013 05:03:26 PM  10/23/2013 09:59:23 AM  DPR Department of Parks and Recreation  Dead Tree   Dead/Dying Tree Street  11215   PLACENAME   BROOKLYN    BARTEL PRITCHARD SQUARE Closed  BROOKLYN
747459   47459   10/21/2013 02:56:08 PM  10/29/2013 06:17:10 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10031   PLACENAME   NEW YORK    CITY COLLEGE    Closed  MANHATTAN
848465   48465   10/21/2013 10:44:10 AM  10/21/2013 11:17:47 AM  NYPD    New York City Police Department Illegal Parking Posted Parking Sign Violation   Street/Sidewalk 11434   PLACENAME   JAMAICA PS 37   Closed  QUEENS
951837   51837   10/20/2013 04:36:12 PM  10/20/2013 06:35:49 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1051848   51848   10/20/2013 04:26:03 PM  10/20/2013 06:34:47 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1154089   54089   10/19/2013 03:45:47 PM  10/19/2013 04:10:11 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
1254343   54343   10/19/2013 01:27:43 PM  10/28/2013 08:42:12 AM  DOT Department of Transportation    Street Condition    Rough, Pitted or Cracked Roads  Street  10003.0 PLACENAME   NEW YORK    UNION SQUARE PARK   Closed  MANHATTAN
1355140   55140   10/19/2013 02:02:28 AM  10/19/2013 02:19:55 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368.0 PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
1457789   57789   10/18/2013 11:55:44 AM  10/23/2013 02:42:14 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1563119   63119   10/17/2013 06:52:37 AM  10/25/2013 06:49:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
1666242   66242   10/16/2013 01:56:24 PM  10/22/2013 03:09:11 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1766758   66758   10/16/2013 11:52:43 AM  10/16/2013 04:35:34 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
1866786   66786   10/16/2013 11:42:23 AM  10/18/2013 04:57:04 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Insurance Information Requested Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
1966809   66809   10/16/2013 11:36:54 AM  10/16/2013 12:34:23 PM  NYPD    New York City Police Department Traffic Congestion/Gridlock Street/Sidewalk 11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
2067465   67465   10/16/2013 09:14:35 AM  10/16/2013 12:43:06 PM  NYPD    New York City Police Department Traffic Drag Racing Street/Sidewalk 11367   PLACENAME   FLUSHING    QUEENS COLLEGE  Closed  QUEENS
2172424   72424   10/15/2013 12:22:00 AM  10/21/2013 12:16:15 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2275531   75531   10/14/2013 10:59:20 AM  10/14/2013 03:09:51 PM  NYPD    New York City Police Department Vending In Prohibited Area  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2377918   77918   10/13/2013 03:16:03 PM  10/13/2013 03:25:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2478048   78048   10/13/2013 01:06:02 PM  10/21/2013 10:20:21 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
2578352   78352   10/13/2013 05:14:33 AM  10/16/2013 01:42:42 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2678383   78383   10/13/2013 03:50:02 AM  10/13/2013 05:03:13 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368   PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
2779078   79078   10/12/2013 09:53:17 PM  10/13/2013 02:52:07 AM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10011   PLACENAME   NEW YORK    WASHINGTON SQUARE PARK  Closed  MANHATTAN
2884489   84489   10/10/2013 07:16:16 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
2984518   84518   10/10/2013 07:02:29 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3084688   84688   10/10/2013 05:39:19 PM  10/10/2013 10:29:17 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3184695   84695   10/10/2013 05:37:04 PM  10/10/2013 10:30:19 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3288812   88812   10/09/2013 09:17:15 PM  10/23/2013 02:15:21 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3389205   89205   10/09/2013 06:01:48 PM  10/09/2013 09:04:26 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
3489382   89382   10/09/2013 04:53:01 PM  10/18/2013 08:35:02 AM  DOT Department of Transportation    Public Toilet   Damaged Door    Sidewalk    11238   PLACENAME   BROOKLYN    GRAND ARMY PLAZA    Closed  BROOKLYN
3589734   89734   10/09/2013 03:13:23 PM  10/09/2013 05:10:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
3693990   93990   10/08/2013 06:14:15 PM  10/09/2013 04:00:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
3799407   99407   10/07/2013 03:56:11 PM  10/08/2013 07:04:14 AM  DPR Department of Parks and Recreation  Overgrown Tree/Branches Traffic Sign or Signal Blocked  Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3899847   99847   10/07/2013 02:33:21 PM  10/09/2013 02:36:42 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10036.0 PLACENAME   NEW YORK    PORT AUTH 42 STREET Closed  MANHATTAN
39100073  100073  10/07/2013 01:36:02 PM  10/09/2013 09:56:55 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10024.0 PLACENAME   NEW YORK    MUSEUM NATURAL HIST Closed  MANHATTAN
40101013  101013  10/07/2013 10:05:18 AM  10/09/2013 03:36:23 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10017.0 PLACENAME   NEW YORK    GRAND CENTRAL TERM  Closed  MANHATTAN
41104020  104020  10/06/2013 02:58:47 PM  10/07/2013 12:11:16 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430.0 PLACENAME   JAMAICA JFK Closed  QUEENS
42106118  106118  10/05/2013 03:24:47 PM  10/05/2013 04:20:34 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
43106499  106499  10/05/2013 11:52:13 AM  10/07/2013 08:00:28 AM  DOT Department of Transportation    Public Toilet   Dirty/Graffiti  Sidewalk    11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
44pd.Timedelta(task3['Closed Date'] - task3['Created Date']).seconds / 60.0
45                         mean                   count
46complaint Type           closing_time_hours     closing_time_hours
47Blocked Driveway         3.00                   4581
48DOF Literature Request   30.16                  5481
49General Construction     66.38                  798
50Heating                  54.88                  6704
51Illegal Parking          3.08                   3336
52Nonconst                 65                     100 
53Paint-Plaster            49                     3281 
54Plumbing                 65                     666   
55Strret Condition         81                     2610    
56Street Light Condition   90                     4207
57

these mean and count values are randomly generated The sample output can be produced by groupby function once the hours are extracted from the data. dictionary format

1Unnamed: 0     Created Date             Closed Date            Agency   Agency Name  Complaint Type Descriptor  Location Type   Incident Zip    Address Type    City    Landmark    Status  Borough
22869    2869    10/30/2013 09:14:47 AM  10/30/2013 10:48:51 AM  NYPD    New York City Police Department Illegal Parking Double Parked Blocking Traffic  Street/Sidewalk 11217.0 PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
323571   23571   10/25/2013 02:33:54 PM  10/25/2013 03:36:36 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
441625   41625   10/22/2013 09:33:56 PM  10/24/2013 05:37:24 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
544331   44331   10/22/2013 07:25:35 AM  10/25/2013 10:40:35 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
646913   46913   10/21/2013 05:03:26 PM  10/23/2013 09:59:23 AM  DPR Department of Parks and Recreation  Dead Tree   Dead/Dying Tree Street  11215   PLACENAME   BROOKLYN    BARTEL PRITCHARD SQUARE Closed  BROOKLYN
747459   47459   10/21/2013 02:56:08 PM  10/29/2013 06:17:10 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10031   PLACENAME   NEW YORK    CITY COLLEGE    Closed  MANHATTAN
848465   48465   10/21/2013 10:44:10 AM  10/21/2013 11:17:47 AM  NYPD    New York City Police Department Illegal Parking Posted Parking Sign Violation   Street/Sidewalk 11434   PLACENAME   JAMAICA PS 37   Closed  QUEENS
951837   51837   10/20/2013 04:36:12 PM  10/20/2013 06:35:49 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1051848   51848   10/20/2013 04:26:03 PM  10/20/2013 06:34:47 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1154089   54089   10/19/2013 03:45:47 PM  10/19/2013 04:10:11 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
1254343   54343   10/19/2013 01:27:43 PM  10/28/2013 08:42:12 AM  DOT Department of Transportation    Street Condition    Rough, Pitted or Cracked Roads  Street  10003.0 PLACENAME   NEW YORK    UNION SQUARE PARK   Closed  MANHATTAN
1355140   55140   10/19/2013 02:02:28 AM  10/19/2013 02:19:55 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368.0 PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
1457789   57789   10/18/2013 11:55:44 AM  10/23/2013 02:42:14 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1563119   63119   10/17/2013 06:52:37 AM  10/25/2013 06:49:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
1666242   66242   10/16/2013 01:56:24 PM  10/22/2013 03:09:11 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1766758   66758   10/16/2013 11:52:43 AM  10/16/2013 04:35:34 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
1866786   66786   10/16/2013 11:42:23 AM  10/18/2013 04:57:04 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Insurance Information Requested Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
1966809   66809   10/16/2013 11:36:54 AM  10/16/2013 12:34:23 PM  NYPD    New York City Police Department Traffic Congestion/Gridlock Street/Sidewalk 11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
2067465   67465   10/16/2013 09:14:35 AM  10/16/2013 12:43:06 PM  NYPD    New York City Police Department Traffic Drag Racing Street/Sidewalk 11367   PLACENAME   FLUSHING    QUEENS COLLEGE  Closed  QUEENS
2172424   72424   10/15/2013 12:22:00 AM  10/21/2013 12:16:15 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2275531   75531   10/14/2013 10:59:20 AM  10/14/2013 03:09:51 PM  NYPD    New York City Police Department Vending In Prohibited Area  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2377918   77918   10/13/2013 03:16:03 PM  10/13/2013 03:25:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2478048   78048   10/13/2013 01:06:02 PM  10/21/2013 10:20:21 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
2578352   78352   10/13/2013 05:14:33 AM  10/16/2013 01:42:42 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2678383   78383   10/13/2013 03:50:02 AM  10/13/2013 05:03:13 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368   PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
2779078   79078   10/12/2013 09:53:17 PM  10/13/2013 02:52:07 AM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10011   PLACENAME   NEW YORK    WASHINGTON SQUARE PARK  Closed  MANHATTAN
2884489   84489   10/10/2013 07:16:16 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
2984518   84518   10/10/2013 07:02:29 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3084688   84688   10/10/2013 05:39:19 PM  10/10/2013 10:29:17 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3184695   84695   10/10/2013 05:37:04 PM  10/10/2013 10:30:19 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3288812   88812   10/09/2013 09:17:15 PM  10/23/2013 02:15:21 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3389205   89205   10/09/2013 06:01:48 PM  10/09/2013 09:04:26 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
3489382   89382   10/09/2013 04:53:01 PM  10/18/2013 08:35:02 AM  DOT Department of Transportation    Public Toilet   Damaged Door    Sidewalk    11238   PLACENAME   BROOKLYN    GRAND ARMY PLAZA    Closed  BROOKLYN
3589734   89734   10/09/2013 03:13:23 PM  10/09/2013 05:10:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
3693990   93990   10/08/2013 06:14:15 PM  10/09/2013 04:00:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
3799407   99407   10/07/2013 03:56:11 PM  10/08/2013 07:04:14 AM  DPR Department of Parks and Recreation  Overgrown Tree/Branches Traffic Sign or Signal Blocked  Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3899847   99847   10/07/2013 02:33:21 PM  10/09/2013 02:36:42 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10036.0 PLACENAME   NEW YORK    PORT AUTH 42 STREET Closed  MANHATTAN
39100073  100073  10/07/2013 01:36:02 PM  10/09/2013 09:56:55 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10024.0 PLACENAME   NEW YORK    MUSEUM NATURAL HIST Closed  MANHATTAN
40101013  101013  10/07/2013 10:05:18 AM  10/09/2013 03:36:23 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10017.0 PLACENAME   NEW YORK    GRAND CENTRAL TERM  Closed  MANHATTAN
41104020  104020  10/06/2013 02:58:47 PM  10/07/2013 12:11:16 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430.0 PLACENAME   JAMAICA JFK Closed  QUEENS
42106118  106118  10/05/2013 03:24:47 PM  10/05/2013 04:20:34 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
43106499  106499  10/05/2013 11:52:13 AM  10/07/2013 08:00:28 AM  DOT Department of Transportation    Public Toilet   Dirty/Graffiti  Sidewalk    11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
44pd.Timedelta(task3['Closed Date'] - task3['Created Date']).seconds / 60.0
45                         mean                   count
46complaint Type           closing_time_hours     closing_time_hours
47Blocked Driveway         3.00                   4581
48DOF Literature Request   30.16                  5481
49General Construction     66.38                  798
50Heating                  54.88                  6704
51Illegal Parking          3.08                   3336
52Nonconst                 65                     100 
53Paint-Plaster            49                     3281 
54Plumbing                 65                     666   
55Strret Condition         81                     2610    
56Street Light Condition   90                     4207
57{'Unnamed: 0': {2869: 2869,
58  23571: 23571,
59  41625: 41625,
60  44331: 44331,
61  46913: 46913,
62  47459: 47459,
63  48465: 48465,
64  51837: 51837,
65  51848: 51848,
66  54089: 54089,
67  54343: 54343,
68  55140: 55140,
69  57789: 57789,
70  63119: 63119,
71  66242: 66242,
72  66758: 66758,
73  66786: 66786,
74  66809: 66809,
75  67465: 67465,
76  72424: 72424,
77  75531: 75531,
78  77918: 77918,
79  78048: 78048,
80  78352: 78352,
81  78383: 78383,
82  79078: 79078,
83  84489: 84489,
84  84518: 84518,
85  84688: 84688,
86  84695: 84695,
87  88812: 88812,
88  89205: 89205,
89  89382: 89382,
90  89734: 89734,
91  93990: 93990,
92  99407: 99407,
93  99847: 99847,
94  100073: 100073,
95  101013: 101013,
96  104020: 104020,
97  106118: 106118,
98  106499: 106499},
99 'Created Date': {2869: '10/30/2013 09:14:47 AM',
100  23571: '10/25/2013 02:33:54 PM',
101  41625: '10/22/2013 09:33:56 PM',
102  44331: '10/22/2013 07:25:35 AM',
103  46913: '10/21/2013 05:03:26 PM',
104  47459: '10/21/2013 02:56:08 PM',
105  48465: '10/21/2013 10:44:10 AM',
106  51837: '10/20/2013 04:36:12 PM',
107  51848: '10/20/2013 04:26:03 PM',
108  54089: '10/19/2013 03:45:47 PM',
109  54343: '10/19/2013 01:27:43 PM',
110  55140: '10/19/2013 02:02:28 AM',
111  57789: '10/18/2013 11:55:44 AM',
112  63119: '10/17/2013 06:52:37 AM',
113  66242: '10/16/2013 01:56:24 PM',
114  66758: '10/16/2013 11:52:43 AM',
115  66786: '10/16/2013 11:42:23 AM',
116  66809: '10/16/2013 11:36:54 AM',
117  67465: '10/16/2013 09:14:35 AM',
118  72424: '10/15/2013 12:22:00 AM',
119  75531: '10/14/2013 10:59:20 AM',
120  77918: '10/13/2013 03:16:03 PM',
121  78048: '10/13/2013 01:06:02 PM',
122  78352: '10/13/2013 05:14:33 AM',
123  78383: '10/13/2013 03:50:02 AM',
124  79078: '10/12/2013 09:53:17 PM',
125  84489: '10/10/2013 07:16:16 PM',
126  84518: '10/10/2013 07:02:29 PM',
127  84688: '10/10/2013 05:39:19 PM',
128  84695: '10/10/2013 05:37:04 PM',
129  88812: '10/09/2013 09:17:15 PM',
130  89205: '10/09/2013 06:01:48 PM',
131  89382: '10/09/2013 04:53:01 PM',
132  89734: '10/09/2013 03:13:23 PM',
133  93990: '10/08/2013 06:14:15 PM',
134  99407: '10/07/2013 03:56:11 PM',
135  99847: '10/07/2013 02:33:21 PM',
136  100073: '10/07/2013 01:36:02 PM',
137  101013: '10/07/2013 10:05:18 AM',
138  104020: '10/06/2013 02:58:47 PM',
139  106118: '10/05/2013 03:24:47 PM',
140  106499: '10/05/2013 11:52:13 AM'},
141 'Closed Date': {2869: '10/30/2013 10:48:51 AM',
142  23571: '10/25/2013 03:36:36 PM',
143  41625: '10/24/2013 05:37:24 PM',
144  44331: '10/25/2013 10:40:35 AM',
145  46913: '10/23/2013 09:59:23 AM',
146  47459: '10/29/2013 06:17:10 PM',
147  48465: '10/21/2013 11:17:47 AM',
148  51837: '10/20/2013 06:35:49 PM',
149  51848: '10/20/2013 06:34:47 PM',
150  54089: '10/19/2013 04:10:11 PM',
151  54343: '10/28/2013 08:42:12 AM',
152  55140: '10/19/2013 02:19:55 AM',
153  57789: '10/23/2013 02:42:14 PM',
154  63119: '10/25/2013 06:49:59 PM',
155  66242: '10/22/2013 03:09:11 PM',
156  66758: '10/16/2013 04:35:34 PM',
157  66786: '10/18/2013 04:57:04 PM',
158  66809: '10/16/2013 12:34:23 PM',
159  67465: '10/16/2013 12:43:06 PM',
160  72424: '10/21/2013 12:16:15 PM',
161  75531: '10/14/2013 03:09:51 PM',
162  77918: '10/13/2013 03:25:45 PM',
163  78048: '10/21/2013 10:20:21 AM',
164  78352: '10/16/2013 01:42:42 PM',
165  78383: '10/13/2013 05:03:13 AM',
166  79078: '10/13/2013 02:52:07 AM',
167  84489: '10/10/2013 10:29:16 PM',
168  84518: '10/10/2013 10:29:16 PM',
169  84688: '10/10/2013 10:29:17 PM',
170  84695: '10/10/2013 10:30:19 PM',
171  88812: '10/23/2013 02:15:21 PM',
172  89205: '10/09/2013 09:04:26 PM',
173  89382: '10/18/2013 08:35:02 AM',
174  89734: '10/09/2013 05:10:45 PM',
175  93990: '10/09/2013 04:00:59 PM',
176  99407: '10/08/2013 07:04:14 AM',
177  99847: '10/09/2013 02:36:42 PM',
178  100073: '10/09/2013 09:56:55 AM',
179  101013: '10/09/2013 03:36:23 PM',
180  104020: '10/07/2013 12:11:16 PM',
181  106118: '10/05/2013 04:20:34 PM',
182  106499: '10/07/2013 08:00:28 AM'},
183 'Agency': {2869: 'NYPD',
184  23571: 'NYPD',
185  41625: 'TLC',
186  44331: 'TLC',
187  46913: 'DPR',
188  47459: 'TLC',
189  48465: 'NYPD',
190  51837: 'NYPD',
191  51848: 'NYPD',
192  54089: 'NYPD',
193  54343: 'DOT',
194  55140: 'NYPD',
195  57789: 'TLC',
196  63119: 'TLC',
197  66242: 'TLC',
198  66758: 'NYPD',
199  66786: 'TLC',
200  66809: 'NYPD',
201  67465: 'NYPD',
202  72424: 'TLC',
203  75531: 'NYPD',
204  77918: 'NYPD',
205  78048: 'TLC',
206  78352: 'TLC',
207  78383: 'NYPD',
208  79078: 'NYPD',
209  84489: 'NYPD',
210  84518: 'NYPD',
211  84688: 'NYPD',
212  84695: 'NYPD',
213  88812: 'TLC',
214  89205: 'NYPD',
215  89382: 'DOT',
216  89734: 'NYPD',
217  93990: 'TLC',
218  99407: 'DPR',
219  99847: 'TLC',
220  100073: 'TLC',
221  101013: 'TLC',
222  104020: 'TLC',
223  106118: 'NYPD',
224  106499: 'DOT'},
225 'Agency Name': {2869: 'New York City Police Department',
226  23571: 'New York City Police Department',
227  41625: 'Taxi and Limousine Commission',
228  44331: 'Taxi and Limousine Commission',
229  46913: 'Department of Parks and Recreation',
230  47459: 'Taxi and Limousine Commission',
231  48465: 'New York City Police Department',
232  51837: 'New York City Police Department',
233  51848: 'New York City Police Department',
234  54089: 'New York City Police Department',
235  54343: 'Department of Transportation',
236  55140: 'New York City Police Department',
237  57789: 'Taxi and Limousine Commission',
238  63119: 'Taxi and Limousine Commission',
239  66242: 'Taxi and Limousine Commission',
240  66758: 'New York City Police Department',
241  66786: 'Taxi and Limousine Commission',
242  66809: 'New York City Police Department',
243  67465: 'New York City Police Department',
244  72424: 'Taxi and Limousine Commission',
245  75531: 'New York City Police Department',
246  77918: 'New York City Police Department',
247  78048: 'Taxi and Limousine Commission',
248  78352: 'Taxi and Limousine Commission',
249  78383: 'New York City Police Department',
250  79078: 'New York City Police Department',
251  84489: 'New York City Police Department',
252  84518: 'New York City Police Department',
253  84688: 'New York City Police Department',
254  84695: 'New York City Police Department',
255  88812: 'Taxi and Limousine Commission',
256  89205: 'New York City Police Department',
257  89382: 'Department of Transportation',
258  89734: 'New York City Police Department',
259  93990: 'Taxi and Limousine Commission',
260  99407: 'Department of Parks and Recreation',
261  99847: 'Taxi and Limousine Commission',
262  100073: 'Taxi and Limousine Commission',
263  101013: 'Taxi and Limousine Commission',
264  104020: 'Taxi and Limousine Commission',
265  106118: 'New York City Police Department',
266  106499: 'Department of Transportation'},
267 'Complaint Type': {2869: 'Illegal Parking',
268  23571: 'Noise - Park',
269  41625: 'For Hire Vehicle Complaint',
270  44331: 'Taxi Complaint',
271  46913: 'Dead Tree',
272  47459: 'Taxi Complaint',
273  48465: 'Illegal Parking',
274  51837: 'Noise - Park',
275  51848: 'Noise - Park',
276  54089: 'Noise - Park',
277  54343: 'Street Condition',
278  55140: 'Noise - Vehicle',
279  57789: 'Taxi Complaint',
280  63119: 'Taxi Complaint',
281  66242: 'Taxi Complaint',
282  66758: 'Vending',
283  66786: 'Taxi Complaint',
284  66809: 'Traffic',
285  67465: 'Traffic',
286  72424: 'Taxi Complaint',
287  75531: 'Vending',
288  77918: 'Noise - Park',
289  78048: 'Taxi Complaint',
290  78352: 'For Hire Vehicle Complaint',
291  78383: 'Noise - Vehicle',
292  79078: 'Noise - Park',
293  84489: 'Noise - Park',
294  84518: 'Noise - Park',
295  84688: 'Noise - Park',
296  84695: 'Noise - Park',
297  88812: 'Taxi Complaint',
298  89205: 'Vending',
299  89382: 'Public Toilet',
300  89734: 'Noise - Park',
301  93990: 'Taxi Complaint',
302  99407: 'Overgrown Tree/Branches',
303  99847: 'Taxi Complaint',
304  100073: 'Taxi Complaint',
305  101013: 'Taxi Complaint',
306  104020: 'For Hire Vehicle Complaint',
307  106118: 'Noise - Park',
308  106499: 'Public Toilet'},
309 'Descriptor': {2869: 'Double Parked Blocking Traffic',
310  23571: 'Loud Music/Party',
311  41625: 'Car Service Company Complaint',
312  44331: 'Driver Complaint',
313  46913: 'Dead/Dying Tree',
314  47459: 'Driver Complaint',
315  48465: 'Posted Parking Sign Violation',
316  51837: 'Loud Music/Party',
317  51848: 'Loud Music/Party',
318  54089: 'Loud Music/Party',
319  54343: 'Rough, Pitted or Cracked Roads',
320  55140: 'Car/Truck Music',
321  57789: 'Driver Complaint',
322  63119: 'Driver Complaint',
323  66242: 'Driver Complaint',
324  66758: 'Unlicensed',
325  66786: 'Insurance Information Requested',
326  66809: 'Congestion/Gridlock',
327  67465: 'Drag Racing',
328  72424: 'Driver Complaint',
329  75531: 'In Prohibited Area',
330  77918: 'Loud Music/Party',
331  78048: 'Driver Complaint',
332  78352: 'Car Service Company Complaint',
333  78383: 'Car/Truck Music',
334  79078: 'Loud Music/Party',
335  84489: 'Loud Music/Party',
336  84518: 'Loud Music/Party',
337  84688: 'Loud Music/Party',
338  84695: 'Loud Music/Party',
339  88812: 'Driver Complaint',
340  89205: 'Unlicensed',
341  89382: 'Damaged Door',
342  89734: 'Loud Music/Party',
343  93990: 'Driver Complaint',
344  99407: 'Traffic Sign or Signal Blocked',
345  99847: 'Driver Complaint',
346  100073: 'Driver Complaint',
347  101013: 'Driver Complaint',
348  104020: 'Car Service Company Complaint',
349  106118: 'Loud Music/Party',
350  106499: 'Dirty/Graffiti'},
351 'Location Type': {2869: 'Street/Sidewalk',
352  23571: 'Park/Playground',
353  41625: 'Street',
354  44331: 'Street',
355  46913: 'Street',
356  47459: 'Street',
357  48465: 'Street/Sidewalk',
358  51837: 'Park/Playground',
359  51848: 'Park/Playground',
360  54089: 'Park/Playground',
361  54343: 'Street',
362  55140: 'Street/Sidewalk',
363  57789: 'Street',
364  63119: 'Street',
365  66242: 'Street',
366  66758: 'Park/Playground',
367  66786: 'Street',
368  66809: 'Street/Sidewalk',
369  67465: 'Street/Sidewalk',
370  72424: 'Street',
371  75531: 'Park/Playground',
372  77918: 'Park/Playground',
373  78048: 'Street',
374  78352: 'Street',
375  78383: 'Street/Sidewalk',
376  79078: 'Park/Playground',
377  84489: 'Park/Playground',
378  84518: 'Park/Playground',
379  84688: 'Park/Playground',
380  84695: 'Park/Playground',
381  88812: 'Street',
382  89205: 'Park/Playground',
383  89382: 'Sidewalk',
384  89734: 'Park/Playground',
385  93990: 'Street',
386  99407: 'Street',
387  99847: 'Street',
388  100073: 'Street',
389  101013: 'Street',
390  104020: 'Street',
391  106118: 'Park/Playground',
392  106499: 'Sidewalk'},
393 'Incident Zip': {2869: '11217.0',
394  23571: '10000',
395  41625: '11430',
396  44331: '11430',
397  46913: '11215',
398  47459: '10031',
399  48465: '11434',
400  51837: '10031.0',
401  51848: '10031.0',
402  54089: '10000.0',
403  54343: '10003.0',
404  55140: '11368.0',
405  57789: '11369.0',
406  63119: '11430.0',
407  66242: '11369',
408  66758: '10036',
409  66786: '10003',
410  66809: '11430',
411  67465: '11367',
412  72424: '11217',
413  75531: '10000',
414  77918: '10000',
415  78048: '11369',
416  78352: '11217',
417  78383: '11368',
418  79078: '10011',
419  84489: '11215',
420  84518: '11215',
421  84688: '11215',
422  84695: '11215',
423  88812: '11430',
424  89205: '10000',
425  89382: '11238',
426  89734: '10036',
427  93990: '10003',
428  99407: '11430.0',
429  99847: '10036.0',
430  100073: '10024.0',
431  101013: '10017.0',
432  104020: '11430.0',
433  106118: '10000.0',
434  106499: '11369.0'},
435 'Address Type': {2869: 'PLACENAME',
436  23571: 'PLACENAME',
437  41625: 'PLACENAME',
438  44331: 'PLACENAME',
439  46913: 'PLACENAME',
440  47459: 'PLACENAME',
441  48465: 'PLACENAME',
442  51837: 'PLACENAME',
443  51848: 'PLACENAME',
444  54089: 'PLACENAME',
445  54343: 'PLACENAME',
446  55140: 'PLACENAME',
447  57789: 'PLACENAME',
448  63119: 'PLACENAME',
449  66242: 'PLACENAME',
450  66758: 'PLACENAME',
451  66786: 'PLACENAME',
452  66809: 'PLACENAME',
453  67465: 'PLACENAME',
454  72424: 'PLACENAME',
455  75531: 'PLACENAME',
456  77918: 'PLACENAME',
457  78048: 'PLACENAME',
458  78352: 'PLACENAME',
459  78383: 'PLACENAME',
460  79078: 'PLACENAME',
461  84489: 'PLACENAME',
462  84518: 'PLACENAME',
463  84688: 'PLACENAME',
464  84695: 'PLACENAME',
465  88812: 'PLACENAME',
466  89205: 'PLACENAME',
467  89382: 'PLACENAME',
468  89734: 'PLACENAME',
469  93990: 'PLACENAME',
470  99407: 'PLACENAME',
471  99847: 'PLACENAME',
472  100073: 'PLACENAME',
473  101013: 'PLACENAME',
474  104020: 'PLACENAME',
475  106118: 'PLACENAME',
476  106499: 'PLACENAME'},
477 'City': {2869: 'BROOKLYN',
478  23571: 'NEW YORK',
479  41625: 'JAMAICA',
480  44331: 'JAMAICA',
481  46913: 'BROOKLYN',
482  47459: 'NEW YORK',
483  48465: 'JAMAICA',
484  51837: 'NEW YORK',
485  51848: 'NEW YORK',
486  54089: 'NEW YORK',
487  54343: 'NEW YORK',
488  55140: 'CORONA',
489  57789: 'EAST ELMHURST',
490  63119: 'JAMAICA',
491  66242: 'EAST ELMHURST',
492  66758: 'NEW YORK',
493  66786: 'NEW YORK',
494  66809: 'JAMAICA',
495  67465: 'FLUSHING',
496  72424: 'BROOKLYN',
497  75531: 'NEW YORK',
498  77918: 'NEW YORK',
499  78048: 'EAST ELMHURST',
500  78352: 'BROOKLYN',
501  78383: 'CORONA',
502  79078: 'NEW YORK',
503  84489: 'BROOKLYN',
504  84518: 'BROOKLYN',
505  84688: 'BROOKLYN',
506  84695: 'BROOKLYN',
507  88812: 'JAMAICA',
508  89205: 'NEW YORK',
509  89382: 'BROOKLYN',
510  89734: 'NEW YORK',
511  93990: 'NEW YORK',
512  99407: 'JAMAICA',
513  99847: 'NEW YORK',
514  100073: 'NEW YORK',
515  101013: 'NEW YORK',
516  104020: 'JAMAICA',
517  106118: 'NEW YORK',
518  106499: 'EAST ELMHURST'},
519 'Landmark': {2869: 'BARCLAYS CENTER',
520  23571: 'CENTRAL PARK',
521  41625: 'J F K AIRPORT',
522  44331: 'J F K AIRPORT',
523  46913: 'BARTEL PRITCHARD SQUARE',
524  47459: 'CITY COLLEGE',
525  48465: 'PS 37',
526  51837: 'JACKIE ROBINSON PARK',
527  51848: 'JACKIE ROBINSON PARK',
528  54089: 'CENTRAL PARK',
529  54343: 'UNION SQUARE PARK',
530  55140: 'WORLDS FAIR MARINA',
531  57789: 'LA GUARDIA AIRPORT',
532  63119: 'J F K AIRPORT',
533  66242: 'LA GUARDIA AIRPORT',
534  66758: 'BRYANT PARK',
535  66786: 'BETH ISRAEL MED CENTER',
536  66809: 'J F K AIRPORT',
537  67465: 'QUEENS COLLEGE',
538  72424: 'BARCLAYS CENTER',
539  75531: 'CENTRAL PARK',
540  77918: 'CENTRAL PARK',
541  78048: 'LA GUARDIA AIRPORT',
542  78352: 'BARCLAYS CENTER',
543  78383: 'WORLDS FAIR MARINA',
544  79078: 'WASHINGTON SQUARE PARK',
545  84489: 'PROSPECT PARK',
546  84518: 'PROSPECT PARK',
547  84688: 'PROSPECT PARK',
548  84695: 'PROSPECT PARK',
549  88812: 'J F K AIRPORT',
550  89205: 'CENTRAL PARK',
551  89382: 'GRAND ARMY PLAZA',
552  89734: 'BRYANT PARK',
553  93990: 'BETH ISRAEL MED CENTER',
554  99407: 'J F K AIRPORT',
555  99847: 'PORT AUTH 42 STREET',
556  100073: 'MUSEUM NATURAL HIST',
557  101013: 'GRAND CENTRAL TERM',
558  104020: 'JFK',
559  106118: 'CENTRAL PARK',
560  106499: 'LA GUARDIA AIRPORT'},
561 'Status': {2869: 'Closed',
562  23571: 'Closed',
563  41625: 'Closed',
564  44331: 'Closed',
565  46913: 'Closed',
566  47459: 'Closed',
567  48465: 'Closed',
568  51837: 'Closed',
569  51848: 'Closed',
570  54089: 'Closed',
571  54343: 'Closed',
572  55140: 'Closed',
573  57789: 'Closed',
574  63119: 'Closed',
575  66242: 'Closed',
576  66758: 'Closed',
577  66786: 'Closed',
578  66809: 'Closed',
579  67465: 'Closed',
580  72424: 'Closed',
581  75531: 'Closed',
582  77918: 'Closed',
583  78048: 'Closed',
584  78352: 'Closed',
585  78383: 'Closed',
586  79078: 'Closed',
587  84489: 'Closed',
588  84518: 'Closed',
589  84688: 'Closed',
590  84695: 'Closed',
591  88812: 'Closed',
592  89205: 'Closed',
593  89382: 'Closed',
594  89734: 'Closed',
595  93990: 'Closed',
596  99407: 'Closed',
597  99847: 'Closed',
598  100073: 'Closed',
599  101013: 'Closed',
600  104020: 'Closed',
601  106118: 'Closed',
602  106499: 'Closed'},
603 'Borough': {2869: 'BROOKLYN',
604  23571: 'MANHATTAN',
605  41625: 'QUEENS',
606  44331: 'QUEENS',
607  46913: 'BROOKLYN',
608  47459: 'MANHATTAN',
609  48465: 'QUEENS',
610  51837: 'MANHATTAN',
611  51848: 'MANHATTAN',
612  54089: 'MANHATTAN',
613  54343: 'MANHATTAN',
614  55140: 'QUEENS',
615  57789: 'QUEENS',
616  63119: 'QUEENS',
617  66242: 'QUEENS',
618  66758: 'MANHATTAN',
619  66786: 'MANHATTAN',
620  66809: 'QUEENS',
621  67465: 'QUEENS',
622  72424: 'BROOKLYN',
623  75531: 'MANHATTAN',
624  77918: 'MANHATTAN',
625  78048: 'QUEENS',
626  78352: 'BROOKLYN',
627  78383: 'QUEENS',
628  79078: 'MANHATTAN',
629  84489: 'BROOKLYN',
630  84518: 'BROOKLYN',
631  84688: 'BROOKLYN',
632  84695: 'BROOKLYN',
633  88812: 'QUEENS',
634  89205: 'MANHATTAN',
635  89382: 'BROOKLYN',
636  89734: 'MANHATTAN',
637  93990: 'MANHATTAN',
638  99407: 'QUEENS',
639  99847: 'MANHATTAN',
640  100073: 'MANHATTAN',
641  101013: 'MANHATTAN',
642  104020: 'QUEENS',
643  106118: 'MANHATTAN',
644  106499: 'QUEENS'}}
645

ANSWER

Answered 2021-Dec-22 at 17:00

You can first start by converting your date columns to datetime type using pd.to_datetime():

1Unnamed: 0     Created Date             Closed Date            Agency   Agency Name  Complaint Type Descriptor  Location Type   Incident Zip    Address Type    City    Landmark    Status  Borough
22869    2869    10/30/2013 09:14:47 AM  10/30/2013 10:48:51 AM  NYPD    New York City Police Department Illegal Parking Double Parked Blocking Traffic  Street/Sidewalk 11217.0 PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
323571   23571   10/25/2013 02:33:54 PM  10/25/2013 03:36:36 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
441625   41625   10/22/2013 09:33:56 PM  10/24/2013 05:37:24 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
544331   44331   10/22/2013 07:25:35 AM  10/25/2013 10:40:35 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
646913   46913   10/21/2013 05:03:26 PM  10/23/2013 09:59:23 AM  DPR Department of Parks and Recreation  Dead Tree   Dead/Dying Tree Street  11215   PLACENAME   BROOKLYN    BARTEL PRITCHARD SQUARE Closed  BROOKLYN
747459   47459   10/21/2013 02:56:08 PM  10/29/2013 06:17:10 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10031   PLACENAME   NEW YORK    CITY COLLEGE    Closed  MANHATTAN
848465   48465   10/21/2013 10:44:10 AM  10/21/2013 11:17:47 AM  NYPD    New York City Police Department Illegal Parking Posted Parking Sign Violation   Street/Sidewalk 11434   PLACENAME   JAMAICA PS 37   Closed  QUEENS
951837   51837   10/20/2013 04:36:12 PM  10/20/2013 06:35:49 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1051848   51848   10/20/2013 04:26:03 PM  10/20/2013 06:34:47 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1154089   54089   10/19/2013 03:45:47 PM  10/19/2013 04:10:11 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
1254343   54343   10/19/2013 01:27:43 PM  10/28/2013 08:42:12 AM  DOT Department of Transportation    Street Condition    Rough, Pitted or Cracked Roads  Street  10003.0 PLACENAME   NEW YORK    UNION SQUARE PARK   Closed  MANHATTAN
1355140   55140   10/19/2013 02:02:28 AM  10/19/2013 02:19:55 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368.0 PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
1457789   57789   10/18/2013 11:55:44 AM  10/23/2013 02:42:14 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1563119   63119   10/17/2013 06:52:37 AM  10/25/2013 06:49:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
1666242   66242   10/16/2013 01:56:24 PM  10/22/2013 03:09:11 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1766758   66758   10/16/2013 11:52:43 AM  10/16/2013 04:35:34 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
1866786   66786   10/16/2013 11:42:23 AM  10/18/2013 04:57:04 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Insurance Information Requested Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
1966809   66809   10/16/2013 11:36:54 AM  10/16/2013 12:34:23 PM  NYPD    New York City Police Department Traffic Congestion/Gridlock Street/Sidewalk 11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
2067465   67465   10/16/2013 09:14:35 AM  10/16/2013 12:43:06 PM  NYPD    New York City Police Department Traffic Drag Racing Street/Sidewalk 11367   PLACENAME   FLUSHING    QUEENS COLLEGE  Closed  QUEENS
2172424   72424   10/15/2013 12:22:00 AM  10/21/2013 12:16:15 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2275531   75531   10/14/2013 10:59:20 AM  10/14/2013 03:09:51 PM  NYPD    New York City Police Department Vending In Prohibited Area  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2377918   77918   10/13/2013 03:16:03 PM  10/13/2013 03:25:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2478048   78048   10/13/2013 01:06:02 PM  10/21/2013 10:20:21 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
2578352   78352   10/13/2013 05:14:33 AM  10/16/2013 01:42:42 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2678383   78383   10/13/2013 03:50:02 AM  10/13/2013 05:03:13 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368   PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
2779078   79078   10/12/2013 09:53:17 PM  10/13/2013 02:52:07 AM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10011   PLACENAME   NEW YORK    WASHINGTON SQUARE PARK  Closed  MANHATTAN
2884489   84489   10/10/2013 07:16:16 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
2984518   84518   10/10/2013 07:02:29 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3084688   84688   10/10/2013 05:39:19 PM  10/10/2013 10:29:17 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3184695   84695   10/10/2013 05:37:04 PM  10/10/2013 10:30:19 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3288812   88812   10/09/2013 09:17:15 PM  10/23/2013 02:15:21 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3389205   89205   10/09/2013 06:01:48 PM  10/09/2013 09:04:26 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
3489382   89382   10/09/2013 04:53:01 PM  10/18/2013 08:35:02 AM  DOT Department of Transportation    Public Toilet   Damaged Door    Sidewalk    11238   PLACENAME   BROOKLYN    GRAND ARMY PLAZA    Closed  BROOKLYN
3589734   89734   10/09/2013 03:13:23 PM  10/09/2013 05:10:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
3693990   93990   10/08/2013 06:14:15 PM  10/09/2013 04:00:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
3799407   99407   10/07/2013 03:56:11 PM  10/08/2013 07:04:14 AM  DPR Department of Parks and Recreation  Overgrown Tree/Branches Traffic Sign or Signal Blocked  Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3899847   99847   10/07/2013 02:33:21 PM  10/09/2013 02:36:42 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10036.0 PLACENAME   NEW YORK    PORT AUTH 42 STREET Closed  MANHATTAN
39100073  100073  10/07/2013 01:36:02 PM  10/09/2013 09:56:55 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10024.0 PLACENAME   NEW YORK    MUSEUM NATURAL HIST Closed  MANHATTAN
40101013  101013  10/07/2013 10:05:18 AM  10/09/2013 03:36:23 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10017.0 PLACENAME   NEW YORK    GRAND CENTRAL TERM  Closed  MANHATTAN
41104020  104020  10/06/2013 02:58:47 PM  10/07/2013 12:11:16 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430.0 PLACENAME   JAMAICA JFK Closed  QUEENS
42106118  106118  10/05/2013 03:24:47 PM  10/05/2013 04:20:34 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
43106499  106499  10/05/2013 11:52:13 AM  10/07/2013 08:00:28 AM  DOT Department of Transportation    Public Toilet   Dirty/Graffiti  Sidewalk    11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
44pd.Timedelta(task3['Closed Date'] - task3['Created Date']).seconds / 60.0
45                         mean                   count
46complaint Type           closing_time_hours     closing_time_hours
47Blocked Driveway         3.00                   4581
48DOF Literature Request   30.16                  5481
49General Construction     66.38                  798
50Heating                  54.88                  6704
51Illegal Parking          3.08                   3336
52Nonconst                 65                     100 
53Paint-Plaster            49                     3281 
54Plumbing                 65                     666   
55Strret Condition         81                     2610    
56Street Light Condition   90                     4207
57{'Unnamed: 0': {2869: 2869,
58  23571: 23571,
59  41625: 41625,
60  44331: 44331,
61  46913: 46913,
62  47459: 47459,
63  48465: 48465,
64  51837: 51837,
65  51848: 51848,
66  54089: 54089,
67  54343: 54343,
68  55140: 55140,
69  57789: 57789,
70  63119: 63119,
71  66242: 66242,
72  66758: 66758,
73  66786: 66786,
74  66809: 66809,
75  67465: 67465,
76  72424: 72424,
77  75531: 75531,
78  77918: 77918,
79  78048: 78048,
80  78352: 78352,
81  78383: 78383,
82  79078: 79078,
83  84489: 84489,
84  84518: 84518,
85  84688: 84688,
86  84695: 84695,
87  88812: 88812,
88  89205: 89205,
89  89382: 89382,
90  89734: 89734,
91  93990: 93990,
92  99407: 99407,
93  99847: 99847,
94  100073: 100073,
95  101013: 101013,
96  104020: 104020,
97  106118: 106118,
98  106499: 106499},
99 'Created Date': {2869: '10/30/2013 09:14:47 AM',
100  23571: '10/25/2013 02:33:54 PM',
101  41625: '10/22/2013 09:33:56 PM',
102  44331: '10/22/2013 07:25:35 AM',
103  46913: '10/21/2013 05:03:26 PM',
104  47459: '10/21/2013 02:56:08 PM',
105  48465: '10/21/2013 10:44:10 AM',
106  51837: '10/20/2013 04:36:12 PM',
107  51848: '10/20/2013 04:26:03 PM',
108  54089: '10/19/2013 03:45:47 PM',
109  54343: '10/19/2013 01:27:43 PM',
110  55140: '10/19/2013 02:02:28 AM',
111  57789: '10/18/2013 11:55:44 AM',
112  63119: '10/17/2013 06:52:37 AM',
113  66242: '10/16/2013 01:56:24 PM',
114  66758: '10/16/2013 11:52:43 AM',
115  66786: '10/16/2013 11:42:23 AM',
116  66809: '10/16/2013 11:36:54 AM',
117  67465: '10/16/2013 09:14:35 AM',
118  72424: '10/15/2013 12:22:00 AM',
119  75531: '10/14/2013 10:59:20 AM',
120  77918: '10/13/2013 03:16:03 PM',
121  78048: '10/13/2013 01:06:02 PM',
122  78352: '10/13/2013 05:14:33 AM',
123  78383: '10/13/2013 03:50:02 AM',
124  79078: '10/12/2013 09:53:17 PM',
125  84489: '10/10/2013 07:16:16 PM',
126  84518: '10/10/2013 07:02:29 PM',
127  84688: '10/10/2013 05:39:19 PM',
128  84695: '10/10/2013 05:37:04 PM',
129  88812: '10/09/2013 09:17:15 PM',
130  89205: '10/09/2013 06:01:48 PM',
131  89382: '10/09/2013 04:53:01 PM',
132  89734: '10/09/2013 03:13:23 PM',
133  93990: '10/08/2013 06:14:15 PM',
134  99407: '10/07/2013 03:56:11 PM',
135  99847: '10/07/2013 02:33:21 PM',
136  100073: '10/07/2013 01:36:02 PM',
137  101013: '10/07/2013 10:05:18 AM',
138  104020: '10/06/2013 02:58:47 PM',
139  106118: '10/05/2013 03:24:47 PM',
140  106499: '10/05/2013 11:52:13 AM'},
141 'Closed Date': {2869: '10/30/2013 10:48:51 AM',
142  23571: '10/25/2013 03:36:36 PM',
143  41625: '10/24/2013 05:37:24 PM',
144  44331: '10/25/2013 10:40:35 AM',
145  46913: '10/23/2013 09:59:23 AM',
146  47459: '10/29/2013 06:17:10 PM',
147  48465: '10/21/2013 11:17:47 AM',
148  51837: '10/20/2013 06:35:49 PM',
149  51848: '10/20/2013 06:34:47 PM',
150  54089: '10/19/2013 04:10:11 PM',
151  54343: '10/28/2013 08:42:12 AM',
152  55140: '10/19/2013 02:19:55 AM',
153  57789: '10/23/2013 02:42:14 PM',
154  63119: '10/25/2013 06:49:59 PM',
155  66242: '10/22/2013 03:09:11 PM',
156  66758: '10/16/2013 04:35:34 PM',
157  66786: '10/18/2013 04:57:04 PM',
158  66809: '10/16/2013 12:34:23 PM',
159  67465: '10/16/2013 12:43:06 PM',
160  72424: '10/21/2013 12:16:15 PM',
161  75531: '10/14/2013 03:09:51 PM',
162  77918: '10/13/2013 03:25:45 PM',
163  78048: '10/21/2013 10:20:21 AM',
164  78352: '10/16/2013 01:42:42 PM',
165  78383: '10/13/2013 05:03:13 AM',
166  79078: '10/13/2013 02:52:07 AM',
167  84489: '10/10/2013 10:29:16 PM',
168  84518: '10/10/2013 10:29:16 PM',
169  84688: '10/10/2013 10:29:17 PM',
170  84695: '10/10/2013 10:30:19 PM',
171  88812: '10/23/2013 02:15:21 PM',
172  89205: '10/09/2013 09:04:26 PM',
173  89382: '10/18/2013 08:35:02 AM',
174  89734: '10/09/2013 05:10:45 PM',
175  93990: '10/09/2013 04:00:59 PM',
176  99407: '10/08/2013 07:04:14 AM',
177  99847: '10/09/2013 02:36:42 PM',
178  100073: '10/09/2013 09:56:55 AM',
179  101013: '10/09/2013 03:36:23 PM',
180  104020: '10/07/2013 12:11:16 PM',
181  106118: '10/05/2013 04:20:34 PM',
182  106499: '10/07/2013 08:00:28 AM'},
183 'Agency': {2869: 'NYPD',
184  23571: 'NYPD',
185  41625: 'TLC',
186  44331: 'TLC',
187  46913: 'DPR',
188  47459: 'TLC',
189  48465: 'NYPD',
190  51837: 'NYPD',
191  51848: 'NYPD',
192  54089: 'NYPD',
193  54343: 'DOT',
194  55140: 'NYPD',
195  57789: 'TLC',
196  63119: 'TLC',
197  66242: 'TLC',
198  66758: 'NYPD',
199  66786: 'TLC',
200  66809: 'NYPD',
201  67465: 'NYPD',
202  72424: 'TLC',
203  75531: 'NYPD',
204  77918: 'NYPD',
205  78048: 'TLC',
206  78352: 'TLC',
207  78383: 'NYPD',
208  79078: 'NYPD',
209  84489: 'NYPD',
210  84518: 'NYPD',
211  84688: 'NYPD',
212  84695: 'NYPD',
213  88812: 'TLC',
214  89205: 'NYPD',
215  89382: 'DOT',
216  89734: 'NYPD',
217  93990: 'TLC',
218  99407: 'DPR',
219  99847: 'TLC',
220  100073: 'TLC',
221  101013: 'TLC',
222  104020: 'TLC',
223  106118: 'NYPD',
224  106499: 'DOT'},
225 'Agency Name': {2869: 'New York City Police Department',
226  23571: 'New York City Police Department',
227  41625: 'Taxi and Limousine Commission',
228  44331: 'Taxi and Limousine Commission',
229  46913: 'Department of Parks and Recreation',
230  47459: 'Taxi and Limousine Commission',
231  48465: 'New York City Police Department',
232  51837: 'New York City Police Department',
233  51848: 'New York City Police Department',
234  54089: 'New York City Police Department',
235  54343: 'Department of Transportation',
236  55140: 'New York City Police Department',
237  57789: 'Taxi and Limousine Commission',
238  63119: 'Taxi and Limousine Commission',
239  66242: 'Taxi and Limousine Commission',
240  66758: 'New York City Police Department',
241  66786: 'Taxi and Limousine Commission',
242  66809: 'New York City Police Department',
243  67465: 'New York City Police Department',
244  72424: 'Taxi and Limousine Commission',
245  75531: 'New York City Police Department',
246  77918: 'New York City Police Department',
247  78048: 'Taxi and Limousine Commission',
248  78352: 'Taxi and Limousine Commission',
249  78383: 'New York City Police Department',
250  79078: 'New York City Police Department',
251  84489: 'New York City Police Department',
252  84518: 'New York City Police Department',
253  84688: 'New York City Police Department',
254  84695: 'New York City Police Department',
255  88812: 'Taxi and Limousine Commission',
256  89205: 'New York City Police Department',
257  89382: 'Department of Transportation',
258  89734: 'New York City Police Department',
259  93990: 'Taxi and Limousine Commission',
260  99407: 'Department of Parks and Recreation',
261  99847: 'Taxi and Limousine Commission',
262  100073: 'Taxi and Limousine Commission',
263  101013: 'Taxi and Limousine Commission',
264  104020: 'Taxi and Limousine Commission',
265  106118: 'New York City Police Department',
266  106499: 'Department of Transportation'},
267 'Complaint Type': {2869: 'Illegal Parking',
268  23571: 'Noise - Park',
269  41625: 'For Hire Vehicle Complaint',
270  44331: 'Taxi Complaint',
271  46913: 'Dead Tree',
272  47459: 'Taxi Complaint',
273  48465: 'Illegal Parking',
274  51837: 'Noise - Park',
275  51848: 'Noise - Park',
276  54089: 'Noise - Park',
277  54343: 'Street Condition',
278  55140: 'Noise - Vehicle',
279  57789: 'Taxi Complaint',
280  63119: 'Taxi Complaint',
281  66242: 'Taxi Complaint',
282  66758: 'Vending',
283  66786: 'Taxi Complaint',
284  66809: 'Traffic',
285  67465: 'Traffic',
286  72424: 'Taxi Complaint',
287  75531: 'Vending',
288  77918: 'Noise - Park',
289  78048: 'Taxi Complaint',
290  78352: 'For Hire Vehicle Complaint',
291  78383: 'Noise - Vehicle',
292  79078: 'Noise - Park',
293  84489: 'Noise - Park',
294  84518: 'Noise - Park',
295  84688: 'Noise - Park',
296  84695: 'Noise - Park',
297  88812: 'Taxi Complaint',
298  89205: 'Vending',
299  89382: 'Public Toilet',
300  89734: 'Noise - Park',
301  93990: 'Taxi Complaint',
302  99407: 'Overgrown Tree/Branches',
303  99847: 'Taxi Complaint',
304  100073: 'Taxi Complaint',
305  101013: 'Taxi Complaint',
306  104020: 'For Hire Vehicle Complaint',
307  106118: 'Noise - Park',
308  106499: 'Public Toilet'},
309 'Descriptor': {2869: 'Double Parked Blocking Traffic',
310  23571: 'Loud Music/Party',
311  41625: 'Car Service Company Complaint',
312  44331: 'Driver Complaint',
313  46913: 'Dead/Dying Tree',
314  47459: 'Driver Complaint',
315  48465: 'Posted Parking Sign Violation',
316  51837: 'Loud Music/Party',
317  51848: 'Loud Music/Party',
318  54089: 'Loud Music/Party',
319  54343: 'Rough, Pitted or Cracked Roads',
320  55140: 'Car/Truck Music',
321  57789: 'Driver Complaint',
322  63119: 'Driver Complaint',
323  66242: 'Driver Complaint',
324  66758: 'Unlicensed',
325  66786: 'Insurance Information Requested',
326  66809: 'Congestion/Gridlock',
327  67465: 'Drag Racing',
328  72424: 'Driver Complaint',
329  75531: 'In Prohibited Area',
330  77918: 'Loud Music/Party',
331  78048: 'Driver Complaint',
332  78352: 'Car Service Company Complaint',
333  78383: 'Car/Truck Music',
334  79078: 'Loud Music/Party',
335  84489: 'Loud Music/Party',
336  84518: 'Loud Music/Party',
337  84688: 'Loud Music/Party',
338  84695: 'Loud Music/Party',
339  88812: 'Driver Complaint',
340  89205: 'Unlicensed',
341  89382: 'Damaged Door',
342  89734: 'Loud Music/Party',
343  93990: 'Driver Complaint',
344  99407: 'Traffic Sign or Signal Blocked',
345  99847: 'Driver Complaint',
346  100073: 'Driver Complaint',
347  101013: 'Driver Complaint',
348  104020: 'Car Service Company Complaint',
349  106118: 'Loud Music/Party',
350  106499: 'Dirty/Graffiti'},
351 'Location Type': {2869: 'Street/Sidewalk',
352  23571: 'Park/Playground',
353  41625: 'Street',
354  44331: 'Street',
355  46913: 'Street',
356  47459: 'Street',
357  48465: 'Street/Sidewalk',
358  51837: 'Park/Playground',
359  51848: 'Park/Playground',
360  54089: 'Park/Playground',
361  54343: 'Street',
362  55140: 'Street/Sidewalk',
363  57789: 'Street',
364  63119: 'Street',
365  66242: 'Street',
366  66758: 'Park/Playground',
367  66786: 'Street',
368  66809: 'Street/Sidewalk',
369  67465: 'Street/Sidewalk',
370  72424: 'Street',
371  75531: 'Park/Playground',
372  77918: 'Park/Playground',
373  78048: 'Street',
374  78352: 'Street',
375  78383: 'Street/Sidewalk',
376  79078: 'Park/Playground',
377  84489: 'Park/Playground',
378  84518: 'Park/Playground',
379  84688: 'Park/Playground',
380  84695: 'Park/Playground',
381  88812: 'Street',
382  89205: 'Park/Playground',
383  89382: 'Sidewalk',
384  89734: 'Park/Playground',
385  93990: 'Street',
386  99407: 'Street',
387  99847: 'Street',
388  100073: 'Street',
389  101013: 'Street',
390  104020: 'Street',
391  106118: 'Park/Playground',
392  106499: 'Sidewalk'},
393 'Incident Zip': {2869: '11217.0',
394  23571: '10000',
395  41625: '11430',
396  44331: '11430',
397  46913: '11215',
398  47459: '10031',
399  48465: '11434',
400  51837: '10031.0',
401  51848: '10031.0',
402  54089: '10000.0',
403  54343: '10003.0',
404  55140: '11368.0',
405  57789: '11369.0',
406  63119: '11430.0',
407  66242: '11369',
408  66758: '10036',
409  66786: '10003',
410  66809: '11430',
411  67465: '11367',
412  72424: '11217',
413  75531: '10000',
414  77918: '10000',
415  78048: '11369',
416  78352: '11217',
417  78383: '11368',
418  79078: '10011',
419  84489: '11215',
420  84518: '11215',
421  84688: '11215',
422  84695: '11215',
423  88812: '11430',
424  89205: '10000',
425  89382: '11238',
426  89734: '10036',
427  93990: '10003',
428  99407: '11430.0',
429  99847: '10036.0',
430  100073: '10024.0',
431  101013: '10017.0',
432  104020: '11430.0',
433  106118: '10000.0',
434  106499: '11369.0'},
435 'Address Type': {2869: 'PLACENAME',
436  23571: 'PLACENAME',
437  41625: 'PLACENAME',
438  44331: 'PLACENAME',
439  46913: 'PLACENAME',
440  47459: 'PLACENAME',
441  48465: 'PLACENAME',
442  51837: 'PLACENAME',
443  51848: 'PLACENAME',
444  54089: 'PLACENAME',
445  54343: 'PLACENAME',
446  55140: 'PLACENAME',
447  57789: 'PLACENAME',
448  63119: 'PLACENAME',
449  66242: 'PLACENAME',
450  66758: 'PLACENAME',
451  66786: 'PLACENAME',
452  66809: 'PLACENAME',
453  67465: 'PLACENAME',
454  72424: 'PLACENAME',
455  75531: 'PLACENAME',
456  77918: 'PLACENAME',
457  78048: 'PLACENAME',
458  78352: 'PLACENAME',
459  78383: 'PLACENAME',
460  79078: 'PLACENAME',
461  84489: 'PLACENAME',
462  84518: 'PLACENAME',
463  84688: 'PLACENAME',
464  84695: 'PLACENAME',
465  88812: 'PLACENAME',
466  89205: 'PLACENAME',
467  89382: 'PLACENAME',
468  89734: 'PLACENAME',
469  93990: 'PLACENAME',
470  99407: 'PLACENAME',
471  99847: 'PLACENAME',
472  100073: 'PLACENAME',
473  101013: 'PLACENAME',
474  104020: 'PLACENAME',
475  106118: 'PLACENAME',
476  106499: 'PLACENAME'},
477 'City': {2869: 'BROOKLYN',
478  23571: 'NEW YORK',
479  41625: 'JAMAICA',
480  44331: 'JAMAICA',
481  46913: 'BROOKLYN',
482  47459: 'NEW YORK',
483  48465: 'JAMAICA',
484  51837: 'NEW YORK',
485  51848: 'NEW YORK',
486  54089: 'NEW YORK',
487  54343: 'NEW YORK',
488  55140: 'CORONA',
489  57789: 'EAST ELMHURST',
490  63119: 'JAMAICA',
491  66242: 'EAST ELMHURST',
492  66758: 'NEW YORK',
493  66786: 'NEW YORK',
494  66809: 'JAMAICA',
495  67465: 'FLUSHING',
496  72424: 'BROOKLYN',
497  75531: 'NEW YORK',
498  77918: 'NEW YORK',
499  78048: 'EAST ELMHURST',
500  78352: 'BROOKLYN',
501  78383: 'CORONA',
502  79078: 'NEW YORK',
503  84489: 'BROOKLYN',
504  84518: 'BROOKLYN',
505  84688: 'BROOKLYN',
506  84695: 'BROOKLYN',
507  88812: 'JAMAICA',
508  89205: 'NEW YORK',
509  89382: 'BROOKLYN',
510  89734: 'NEW YORK',
511  93990: 'NEW YORK',
512  99407: 'JAMAICA',
513  99847: 'NEW YORK',
514  100073: 'NEW YORK',
515  101013: 'NEW YORK',
516  104020: 'JAMAICA',
517  106118: 'NEW YORK',
518  106499: 'EAST ELMHURST'},
519 'Landmark': {2869: 'BARCLAYS CENTER',
520  23571: 'CENTRAL PARK',
521  41625: 'J F K AIRPORT',
522  44331: 'J F K AIRPORT',
523  46913: 'BARTEL PRITCHARD SQUARE',
524  47459: 'CITY COLLEGE',
525  48465: 'PS 37',
526  51837: 'JACKIE ROBINSON PARK',
527  51848: 'JACKIE ROBINSON PARK',
528  54089: 'CENTRAL PARK',
529  54343: 'UNION SQUARE PARK',
530  55140: 'WORLDS FAIR MARINA',
531  57789: 'LA GUARDIA AIRPORT',
532  63119: 'J F K AIRPORT',
533  66242: 'LA GUARDIA AIRPORT',
534  66758: 'BRYANT PARK',
535  66786: 'BETH ISRAEL MED CENTER',
536  66809: 'J F K AIRPORT',
537  67465: 'QUEENS COLLEGE',
538  72424: 'BARCLAYS CENTER',
539  75531: 'CENTRAL PARK',
540  77918: 'CENTRAL PARK',
541  78048: 'LA GUARDIA AIRPORT',
542  78352: 'BARCLAYS CENTER',
543  78383: 'WORLDS FAIR MARINA',
544  79078: 'WASHINGTON SQUARE PARK',
545  84489: 'PROSPECT PARK',
546  84518: 'PROSPECT PARK',
547  84688: 'PROSPECT PARK',
548  84695: 'PROSPECT PARK',
549  88812: 'J F K AIRPORT',
550  89205: 'CENTRAL PARK',
551  89382: 'GRAND ARMY PLAZA',
552  89734: 'BRYANT PARK',
553  93990: 'BETH ISRAEL MED CENTER',
554  99407: 'J F K AIRPORT',
555  99847: 'PORT AUTH 42 STREET',
556  100073: 'MUSEUM NATURAL HIST',
557  101013: 'GRAND CENTRAL TERM',
558  104020: 'JFK',
559  106118: 'CENTRAL PARK',
560  106499: 'LA GUARDIA AIRPORT'},
561 'Status': {2869: 'Closed',
562  23571: 'Closed',
563  41625: 'Closed',
564  44331: 'Closed',
565  46913: 'Closed',
566  47459: 'Closed',
567  48465: 'Closed',
568  51837: 'Closed',
569  51848: 'Closed',
570  54089: 'Closed',
571  54343: 'Closed',
572  55140: 'Closed',
573  57789: 'Closed',
574  63119: 'Closed',
575  66242: 'Closed',
576  66758: 'Closed',
577  66786: 'Closed',
578  66809: 'Closed',
579  67465: 'Closed',
580  72424: 'Closed',
581  75531: 'Closed',
582  77918: 'Closed',
583  78048: 'Closed',
584  78352: 'Closed',
585  78383: 'Closed',
586  79078: 'Closed',
587  84489: 'Closed',
588  84518: 'Closed',
589  84688: 'Closed',
590  84695: 'Closed',
591  88812: 'Closed',
592  89205: 'Closed',
593  89382: 'Closed',
594  89734: 'Closed',
595  93990: 'Closed',
596  99407: 'Closed',
597  99847: 'Closed',
598  100073: 'Closed',
599  101013: 'Closed',
600  104020: 'Closed',
601  106118: 'Closed',
602  106499: 'Closed'},
603 'Borough': {2869: 'BROOKLYN',
604  23571: 'MANHATTAN',
605  41625: 'QUEENS',
606  44331: 'QUEENS',
607  46913: 'BROOKLYN',
608  47459: 'MANHATTAN',
609  48465: 'QUEENS',
610  51837: 'MANHATTAN',
611  51848: 'MANHATTAN',
612  54089: 'MANHATTAN',
613  54343: 'MANHATTAN',
614  55140: 'QUEENS',
615  57789: 'QUEENS',
616  63119: 'QUEENS',
617  66242: 'QUEENS',
618  66758: 'MANHATTAN',
619  66786: 'MANHATTAN',
620  66809: 'QUEENS',
621  67465: 'QUEENS',
622  72424: 'BROOKLYN',
623  75531: 'MANHATTAN',
624  77918: 'MANHATTAN',
625  78048: 'QUEENS',
626  78352: 'BROOKLYN',
627  78383: 'QUEENS',
628  79078: 'MANHATTAN',
629  84489: 'BROOKLYN',
630  84518: 'BROOKLYN',
631  84688: 'BROOKLYN',
632  84695: 'BROOKLYN',
633  88812: 'QUEENS',
634  89205: 'MANHATTAN',
635  89382: 'BROOKLYN',
636  89734: 'MANHATTAN',
637  93990: 'MANHATTAN',
638  99407: 'QUEENS',
639  99847: 'MANHATTAN',
640  100073: 'MANHATTAN',
641  101013: 'MANHATTAN',
642  104020: 'QUEENS',
643  106118: 'MANHATTAN',
644  106499: 'QUEENS'}}
645for c in ['Created Date', 'Closed Date']:
646    df[c] = pd.to_datetime(df[c])
647    #df[c+'_date'] = df[c].dt.date # to extract the date (for created + closed)
648    #df[c+'_time'] = df[c].dt.time # to extract the time (for created + closed)
649

Then you can calculate the difference in time between the two as a new column (as hours) .astype('timedelta64[h]'), and then calculate a grouped mean:

1Unnamed: 0     Created Date             Closed Date            Agency   Agency Name  Complaint Type Descriptor  Location Type   Incident Zip    Address Type    City    Landmark    Status  Borough
22869    2869    10/30/2013 09:14:47 AM  10/30/2013 10:48:51 AM  NYPD    New York City Police Department Illegal Parking Double Parked Blocking Traffic  Street/Sidewalk 11217.0 PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
323571   23571   10/25/2013 02:33:54 PM  10/25/2013 03:36:36 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
441625   41625   10/22/2013 09:33:56 PM  10/24/2013 05:37:24 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
544331   44331   10/22/2013 07:25:35 AM  10/25/2013 10:40:35 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
646913   46913   10/21/2013 05:03:26 PM  10/23/2013 09:59:23 AM  DPR Department of Parks and Recreation  Dead Tree   Dead/Dying Tree Street  11215   PLACENAME   BROOKLYN    BARTEL PRITCHARD SQUARE Closed  BROOKLYN
747459   47459   10/21/2013 02:56:08 PM  10/29/2013 06:17:10 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10031   PLACENAME   NEW YORK    CITY COLLEGE    Closed  MANHATTAN
848465   48465   10/21/2013 10:44:10 AM  10/21/2013 11:17:47 AM  NYPD    New York City Police Department Illegal Parking Posted Parking Sign Violation   Street/Sidewalk 11434   PLACENAME   JAMAICA PS 37   Closed  QUEENS
951837   51837   10/20/2013 04:36:12 PM  10/20/2013 06:35:49 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1051848   51848   10/20/2013 04:26:03 PM  10/20/2013 06:34:47 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1154089   54089   10/19/2013 03:45:47 PM  10/19/2013 04:10:11 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
1254343   54343   10/19/2013 01:27:43 PM  10/28/2013 08:42:12 AM  DOT Department of Transportation    Street Condition    Rough, Pitted or Cracked Roads  Street  10003.0 PLACENAME   NEW YORK    UNION SQUARE PARK   Closed  MANHATTAN
1355140   55140   10/19/2013 02:02:28 AM  10/19/2013 02:19:55 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368.0 PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
1457789   57789   10/18/2013 11:55:44 AM  10/23/2013 02:42:14 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1563119   63119   10/17/2013 06:52:37 AM  10/25/2013 06:49:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
1666242   66242   10/16/2013 01:56:24 PM  10/22/2013 03:09:11 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1766758   66758   10/16/2013 11:52:43 AM  10/16/2013 04:35:34 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
1866786   66786   10/16/2013 11:42:23 AM  10/18/2013 04:57:04 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Insurance Information Requested Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
1966809   66809   10/16/2013 11:36:54 AM  10/16/2013 12:34:23 PM  NYPD    New York City Police Department Traffic Congestion/Gridlock Street/Sidewalk 11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
2067465   67465   10/16/2013 09:14:35 AM  10/16/2013 12:43:06 PM  NYPD    New York City Police Department Traffic Drag Racing Street/Sidewalk 11367   PLACENAME   FLUSHING    QUEENS COLLEGE  Closed  QUEENS
2172424   72424   10/15/2013 12:22:00 AM  10/21/2013 12:16:15 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2275531   75531   10/14/2013 10:59:20 AM  10/14/2013 03:09:51 PM  NYPD    New York City Police Department Vending In Prohibited Area  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2377918   77918   10/13/2013 03:16:03 PM  10/13/2013 03:25:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2478048   78048   10/13/2013 01:06:02 PM  10/21/2013 10:20:21 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
2578352   78352   10/13/2013 05:14:33 AM  10/16/2013 01:42:42 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2678383   78383   10/13/2013 03:50:02 AM  10/13/2013 05:03:13 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368   PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
2779078   79078   10/12/2013 09:53:17 PM  10/13/2013 02:52:07 AM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10011   PLACENAME   NEW YORK    WASHINGTON SQUARE PARK  Closed  MANHATTAN
2884489   84489   10/10/2013 07:16:16 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
2984518   84518   10/10/2013 07:02:29 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3084688   84688   10/10/2013 05:39:19 PM  10/10/2013 10:29:17 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3184695   84695   10/10/2013 05:37:04 PM  10/10/2013 10:30:19 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3288812   88812   10/09/2013 09:17:15 PM  10/23/2013 02:15:21 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3389205   89205   10/09/2013 06:01:48 PM  10/09/2013 09:04:26 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
3489382   89382   10/09/2013 04:53:01 PM  10/18/2013 08:35:02 AM  DOT Department of Transportation    Public Toilet   Damaged Door    Sidewalk    11238   PLACENAME   BROOKLYN    GRAND ARMY PLAZA    Closed  BROOKLYN
3589734   89734   10/09/2013 03:13:23 PM  10/09/2013 05:10:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
3693990   93990   10/08/2013 06:14:15 PM  10/09/2013 04:00:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
3799407   99407   10/07/2013 03:56:11 PM  10/08/2013 07:04:14 AM  DPR Department of Parks and Recreation  Overgrown Tree/Branches Traffic Sign or Signal Blocked  Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3899847   99847   10/07/2013 02:33:21 PM  10/09/2013 02:36:42 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10036.0 PLACENAME   NEW YORK    PORT AUTH 42 STREET Closed  MANHATTAN
39100073  100073  10/07/2013 01:36:02 PM  10/09/2013 09:56:55 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10024.0 PLACENAME   NEW YORK    MUSEUM NATURAL HIST Closed  MANHATTAN
40101013  101013  10/07/2013 10:05:18 AM  10/09/2013 03:36:23 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10017.0 PLACENAME   NEW YORK    GRAND CENTRAL TERM  Closed  MANHATTAN
41104020  104020  10/06/2013 02:58:47 PM  10/07/2013 12:11:16 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430.0 PLACENAME   JAMAICA JFK Closed  QUEENS
42106118  106118  10/05/2013 03:24:47 PM  10/05/2013 04:20:34 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
43106499  106499  10/05/2013 11:52:13 AM  10/07/2013 08:00:28 AM  DOT Department of Transportation    Public Toilet   Dirty/Graffiti  Sidewalk    11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
44pd.Timedelta(task3['Closed Date'] - task3['Created Date']).seconds / 60.0
45                         mean                   count
46complaint Type           closing_time_hours     closing_time_hours
47Blocked Driveway         3.00                   4581
48DOF Literature Request   30.16                  5481
49General Construction     66.38                  798
50Heating                  54.88                  6704
51Illegal Parking          3.08                   3336
52Nonconst                 65                     100 
53Paint-Plaster            49                     3281 
54Plumbing                 65                     666   
55Strret Condition         81                     2610    
56Street Light Condition   90                     4207
57{'Unnamed: 0': {2869: 2869,
58  23571: 23571,
59  41625: 41625,
60  44331: 44331,
61  46913: 46913,
62  47459: 47459,
63  48465: 48465,
64  51837: 51837,
65  51848: 51848,
66  54089: 54089,
67  54343: 54343,
68  55140: 55140,
69  57789: 57789,
70  63119: 63119,
71  66242: 66242,
72  66758: 66758,
73  66786: 66786,
74  66809: 66809,
75  67465: 67465,
76  72424: 72424,
77  75531: 75531,
78  77918: 77918,
79  78048: 78048,
80  78352: 78352,
81  78383: 78383,
82  79078: 79078,
83  84489: 84489,
84  84518: 84518,
85  84688: 84688,
86  84695: 84695,
87  88812: 88812,
88  89205: 89205,
89  89382: 89382,
90  89734: 89734,
91  93990: 93990,
92  99407: 99407,
93  99847: 99847,
94  100073: 100073,
95  101013: 101013,
96  104020: 104020,
97  106118: 106118,
98  106499: 106499},
99 'Created Date': {2869: '10/30/2013 09:14:47 AM',
100  23571: '10/25/2013 02:33:54 PM',
101  41625: '10/22/2013 09:33:56 PM',
102  44331: '10/22/2013 07:25:35 AM',
103  46913: '10/21/2013 05:03:26 PM',
104  47459: '10/21/2013 02:56:08 PM',
105  48465: '10/21/2013 10:44:10 AM',
106  51837: '10/20/2013 04:36:12 PM',
107  51848: '10/20/2013 04:26:03 PM',
108  54089: '10/19/2013 03:45:47 PM',
109  54343: '10/19/2013 01:27:43 PM',
110  55140: '10/19/2013 02:02:28 AM',
111  57789: '10/18/2013 11:55:44 AM',
112  63119: '10/17/2013 06:52:37 AM',
113  66242: '10/16/2013 01:56:24 PM',
114  66758: '10/16/2013 11:52:43 AM',
115  66786: '10/16/2013 11:42:23 AM',
116  66809: '10/16/2013 11:36:54 AM',
117  67465: '10/16/2013 09:14:35 AM',
118  72424: '10/15/2013 12:22:00 AM',
119  75531: '10/14/2013 10:59:20 AM',
120  77918: '10/13/2013 03:16:03 PM',
121  78048: '10/13/2013 01:06:02 PM',
122  78352: '10/13/2013 05:14:33 AM',
123  78383: '10/13/2013 03:50:02 AM',
124  79078: '10/12/2013 09:53:17 PM',
125  84489: '10/10/2013 07:16:16 PM',
126  84518: '10/10/2013 07:02:29 PM',
127  84688: '10/10/2013 05:39:19 PM',
128  84695: '10/10/2013 05:37:04 PM',
129  88812: '10/09/2013 09:17:15 PM',
130  89205: '10/09/2013 06:01:48 PM',
131  89382: '10/09/2013 04:53:01 PM',
132  89734: '10/09/2013 03:13:23 PM',
133  93990: '10/08/2013 06:14:15 PM',
134  99407: '10/07/2013 03:56:11 PM',
135  99847: '10/07/2013 02:33:21 PM',
136  100073: '10/07/2013 01:36:02 PM',
137  101013: '10/07/2013 10:05:18 AM',
138  104020: '10/06/2013 02:58:47 PM',
139  106118: '10/05/2013 03:24:47 PM',
140  106499: '10/05/2013 11:52:13 AM'},
141 'Closed Date': {2869: '10/30/2013 10:48:51 AM',
142  23571: '10/25/2013 03:36:36 PM',
143  41625: '10/24/2013 05:37:24 PM',
144  44331: '10/25/2013 10:40:35 AM',
145  46913: '10/23/2013 09:59:23 AM',
146  47459: '10/29/2013 06:17:10 PM',
147  48465: '10/21/2013 11:17:47 AM',
148  51837: '10/20/2013 06:35:49 PM',
149  51848: '10/20/2013 06:34:47 PM',
150  54089: '10/19/2013 04:10:11 PM',
151  54343: '10/28/2013 08:42:12 AM',
152  55140: '10/19/2013 02:19:55 AM',
153  57789: '10/23/2013 02:42:14 PM',
154  63119: '10/25/2013 06:49:59 PM',
155  66242: '10/22/2013 03:09:11 PM',
156  66758: '10/16/2013 04:35:34 PM',
157  66786: '10/18/2013 04:57:04 PM',
158  66809: '10/16/2013 12:34:23 PM',
159  67465: '10/16/2013 12:43:06 PM',
160  72424: '10/21/2013 12:16:15 PM',
161  75531: '10/14/2013 03:09:51 PM',
162  77918: '10/13/2013 03:25:45 PM',
163  78048: '10/21/2013 10:20:21 AM',
164  78352: '10/16/2013 01:42:42 PM',
165  78383: '10/13/2013 05:03:13 AM',
166  79078: '10/13/2013 02:52:07 AM',
167  84489: '10/10/2013 10:29:16 PM',
168  84518: '10/10/2013 10:29:16 PM',
169  84688: '10/10/2013 10:29:17 PM',
170  84695: '10/10/2013 10:30:19 PM',
171  88812: '10/23/2013 02:15:21 PM',
172  89205: '10/09/2013 09:04:26 PM',
173  89382: '10/18/2013 08:35:02 AM',
174  89734: '10/09/2013 05:10:45 PM',
175  93990: '10/09/2013 04:00:59 PM',
176  99407: '10/08/2013 07:04:14 AM',
177  99847: '10/09/2013 02:36:42 PM',
178  100073: '10/09/2013 09:56:55 AM',
179  101013: '10/09/2013 03:36:23 PM',
180  104020: '10/07/2013 12:11:16 PM',
181  106118: '10/05/2013 04:20:34 PM',
182  106499: '10/07/2013 08:00:28 AM'},
183 'Agency': {2869: 'NYPD',
184  23571: 'NYPD',
185  41625: 'TLC',
186  44331: 'TLC',
187  46913: 'DPR',
188  47459: 'TLC',
189  48465: 'NYPD',
190  51837: 'NYPD',
191  51848: 'NYPD',
192  54089: 'NYPD',
193  54343: 'DOT',
194  55140: 'NYPD',
195  57789: 'TLC',
196  63119: 'TLC',
197  66242: 'TLC',
198  66758: 'NYPD',
199  66786: 'TLC',
200  66809: 'NYPD',
201  67465: 'NYPD',
202  72424: 'TLC',
203  75531: 'NYPD',
204  77918: 'NYPD',
205  78048: 'TLC',
206  78352: 'TLC',
207  78383: 'NYPD',
208  79078: 'NYPD',
209  84489: 'NYPD',
210  84518: 'NYPD',
211  84688: 'NYPD',
212  84695: 'NYPD',
213  88812: 'TLC',
214  89205: 'NYPD',
215  89382: 'DOT',
216  89734: 'NYPD',
217  93990: 'TLC',
218  99407: 'DPR',
219  99847: 'TLC',
220  100073: 'TLC',
221  101013: 'TLC',
222  104020: 'TLC',
223  106118: 'NYPD',
224  106499: 'DOT'},
225 'Agency Name': {2869: 'New York City Police Department',
226  23571: 'New York City Police Department',
227  41625: 'Taxi and Limousine Commission',
228  44331: 'Taxi and Limousine Commission',
229  46913: 'Department of Parks and Recreation',
230  47459: 'Taxi and Limousine Commission',
231  48465: 'New York City Police Department',
232  51837: 'New York City Police Department',
233  51848: 'New York City Police Department',
234  54089: 'New York City Police Department',
235  54343: 'Department of Transportation',
236  55140: 'New York City Police Department',
237  57789: 'Taxi and Limousine Commission',
238  63119: 'Taxi and Limousine Commission',
239  66242: 'Taxi and Limousine Commission',
240  66758: 'New York City Police Department',
241  66786: 'Taxi and Limousine Commission',
242  66809: 'New York City Police Department',
243  67465: 'New York City Police Department',
244  72424: 'Taxi and Limousine Commission',
245  75531: 'New York City Police Department',
246  77918: 'New York City Police Department',
247  78048: 'Taxi and Limousine Commission',
248  78352: 'Taxi and Limousine Commission',
249  78383: 'New York City Police Department',
250  79078: 'New York City Police Department',
251  84489: 'New York City Police Department',
252  84518: 'New York City Police Department',
253  84688: 'New York City Police Department',
254  84695: 'New York City Police Department',
255  88812: 'Taxi and Limousine Commission',
256  89205: 'New York City Police Department',
257  89382: 'Department of Transportation',
258  89734: 'New York City Police Department',
259  93990: 'Taxi and Limousine Commission',
260  99407: 'Department of Parks and Recreation',
261  99847: 'Taxi and Limousine Commission',
262  100073: 'Taxi and Limousine Commission',
263  101013: 'Taxi and Limousine Commission',
264  104020: 'Taxi and Limousine Commission',
265  106118: 'New York City Police Department',
266  106499: 'Department of Transportation'},
267 'Complaint Type': {2869: 'Illegal Parking',
268  23571: 'Noise - Park',
269  41625: 'For Hire Vehicle Complaint',
270  44331: 'Taxi Complaint',
271  46913: 'Dead Tree',
272  47459: 'Taxi Complaint',
273  48465: 'Illegal Parking',
274  51837: 'Noise - Park',
275  51848: 'Noise - Park',
276  54089: 'Noise - Park',
277  54343: 'Street Condition',
278  55140: 'Noise - Vehicle',
279  57789: 'Taxi Complaint',
280  63119: 'Taxi Complaint',
281  66242: 'Taxi Complaint',
282  66758: 'Vending',
283  66786: 'Taxi Complaint',
284  66809: 'Traffic',
285  67465: 'Traffic',
286  72424: 'Taxi Complaint',
287  75531: 'Vending',
288  77918: 'Noise - Park',
289  78048: 'Taxi Complaint',
290  78352: 'For Hire Vehicle Complaint',
291  78383: 'Noise - Vehicle',
292  79078: 'Noise - Park',
293  84489: 'Noise - Park',
294  84518: 'Noise - Park',
295  84688: 'Noise - Park',
296  84695: 'Noise - Park',
297  88812: 'Taxi Complaint',
298  89205: 'Vending',
299  89382: 'Public Toilet',
300  89734: 'Noise - Park',
301  93990: 'Taxi Complaint',
302  99407: 'Overgrown Tree/Branches',
303  99847: 'Taxi Complaint',
304  100073: 'Taxi Complaint',
305  101013: 'Taxi Complaint',
306  104020: 'For Hire Vehicle Complaint',
307  106118: 'Noise - Park',
308  106499: 'Public Toilet'},
309 'Descriptor': {2869: 'Double Parked Blocking Traffic',
310  23571: 'Loud Music/Party',
311  41625: 'Car Service Company Complaint',
312  44331: 'Driver Complaint',
313  46913: 'Dead/Dying Tree',
314  47459: 'Driver Complaint',
315  48465: 'Posted Parking Sign Violation',
316  51837: 'Loud Music/Party',
317  51848: 'Loud Music/Party',
318  54089: 'Loud Music/Party',
319  54343: 'Rough, Pitted or Cracked Roads',
320  55140: 'Car/Truck Music',
321  57789: 'Driver Complaint',
322  63119: 'Driver Complaint',
323  66242: 'Driver Complaint',
324  66758: 'Unlicensed',
325  66786: 'Insurance Information Requested',
326  66809: 'Congestion/Gridlock',
327  67465: 'Drag Racing',
328  72424: 'Driver Complaint',
329  75531: 'In Prohibited Area',
330  77918: 'Loud Music/Party',
331  78048: 'Driver Complaint',
332  78352: 'Car Service Company Complaint',
333  78383: 'Car/Truck Music',
334  79078: 'Loud Music/Party',
335  84489: 'Loud Music/Party',
336  84518: 'Loud Music/Party',
337  84688: 'Loud Music/Party',
338  84695: 'Loud Music/Party',
339  88812: 'Driver Complaint',
340  89205: 'Unlicensed',
341  89382: 'Damaged Door',
342  89734: 'Loud Music/Party',
343  93990: 'Driver Complaint',
344  99407: 'Traffic Sign or Signal Blocked',
345  99847: 'Driver Complaint',
346  100073: 'Driver Complaint',
347  101013: 'Driver Complaint',
348  104020: 'Car Service Company Complaint',
349  106118: 'Loud Music/Party',
350  106499: 'Dirty/Graffiti'},
351 'Location Type': {2869: 'Street/Sidewalk',
352  23571: 'Park/Playground',
353  41625: 'Street',
354  44331: 'Street',
355  46913: 'Street',
356  47459: 'Street',
357  48465: 'Street/Sidewalk',
358  51837: 'Park/Playground',
359  51848: 'Park/Playground',
360  54089: 'Park/Playground',
361  54343: 'Street',
362  55140: 'Street/Sidewalk',
363  57789: 'Street',
364  63119: 'Street',
365  66242: 'Street',
366  66758: 'Park/Playground',
367  66786: 'Street',
368  66809: 'Street/Sidewalk',
369  67465: 'Street/Sidewalk',
370  72424: 'Street',
371  75531: 'Park/Playground',
372  77918: 'Park/Playground',
373  78048: 'Street',
374  78352: 'Street',
375  78383: 'Street/Sidewalk',
376  79078: 'Park/Playground',
377  84489: 'Park/Playground',
378  84518: 'Park/Playground',
379  84688: 'Park/Playground',
380  84695: 'Park/Playground',
381  88812: 'Street',
382  89205: 'Park/Playground',
383  89382: 'Sidewalk',
384  89734: 'Park/Playground',
385  93990: 'Street',
386  99407: 'Street',
387  99847: 'Street',
388  100073: 'Street',
389  101013: 'Street',
390  104020: 'Street',
391  106118: 'Park/Playground',
392  106499: 'Sidewalk'},
393 'Incident Zip': {2869: '11217.0',
394  23571: '10000',
395  41625: '11430',
396  44331: '11430',
397  46913: '11215',
398  47459: '10031',
399  48465: '11434',
400  51837: '10031.0',
401  51848: '10031.0',
402  54089: '10000.0',
403  54343: '10003.0',
404  55140: '11368.0',
405  57789: '11369.0',
406  63119: '11430.0',
407  66242: '11369',
408  66758: '10036',
409  66786: '10003',
410  66809: '11430',
411  67465: '11367',
412  72424: '11217',
413  75531: '10000',
414  77918: '10000',
415  78048: '11369',
416  78352: '11217',
417  78383: '11368',
418  79078: '10011',
419  84489: '11215',
420  84518: '11215',
421  84688: '11215',
422  84695: '11215',
423  88812: '11430',
424  89205: '10000',
425  89382: '11238',
426  89734: '10036',
427  93990: '10003',
428  99407: '11430.0',
429  99847: '10036.0',
430  100073: '10024.0',
431  101013: '10017.0',
432  104020: '11430.0',
433  106118: '10000.0',
434  106499: '11369.0'},
435 'Address Type': {2869: 'PLACENAME',
436  23571: 'PLACENAME',
437  41625: 'PLACENAME',
438  44331: 'PLACENAME',
439  46913: 'PLACENAME',
440  47459: 'PLACENAME',
441  48465: 'PLACENAME',
442  51837: 'PLACENAME',
443  51848: 'PLACENAME',
444  54089: 'PLACENAME',
445  54343: 'PLACENAME',
446  55140: 'PLACENAME',
447  57789: 'PLACENAME',
448  63119: 'PLACENAME',
449  66242: 'PLACENAME',
450  66758: 'PLACENAME',
451  66786: 'PLACENAME',
452  66809: 'PLACENAME',
453  67465: 'PLACENAME',
454  72424: 'PLACENAME',
455  75531: 'PLACENAME',
456  77918: 'PLACENAME',
457  78048: 'PLACENAME',
458  78352: 'PLACENAME',
459  78383: 'PLACENAME',
460  79078: 'PLACENAME',
461  84489: 'PLACENAME',
462  84518: 'PLACENAME',
463  84688: 'PLACENAME',
464  84695: 'PLACENAME',
465  88812: 'PLACENAME',
466  89205: 'PLACENAME',
467  89382: 'PLACENAME',
468  89734: 'PLACENAME',
469  93990: 'PLACENAME',
470  99407: 'PLACENAME',
471  99847: 'PLACENAME',
472  100073: 'PLACENAME',
473  101013: 'PLACENAME',
474  104020: 'PLACENAME',
475  106118: 'PLACENAME',
476  106499: 'PLACENAME'},
477 'City': {2869: 'BROOKLYN',
478  23571: 'NEW YORK',
479  41625: 'JAMAICA',
480  44331: 'JAMAICA',
481  46913: 'BROOKLYN',
482  47459: 'NEW YORK',
483  48465: 'JAMAICA',
484  51837: 'NEW YORK',
485  51848: 'NEW YORK',
486  54089: 'NEW YORK',
487  54343: 'NEW YORK',
488  55140: 'CORONA',
489  57789: 'EAST ELMHURST',
490  63119: 'JAMAICA',
491  66242: 'EAST ELMHURST',
492  66758: 'NEW YORK',
493  66786: 'NEW YORK',
494  66809: 'JAMAICA',
495  67465: 'FLUSHING',
496  72424: 'BROOKLYN',
497  75531: 'NEW YORK',
498  77918: 'NEW YORK',
499  78048: 'EAST ELMHURST',
500  78352: 'BROOKLYN',
501  78383: 'CORONA',
502  79078: 'NEW YORK',
503  84489: 'BROOKLYN',
504  84518: 'BROOKLYN',
505  84688: 'BROOKLYN',
506  84695: 'BROOKLYN',
507  88812: 'JAMAICA',
508  89205: 'NEW YORK',
509  89382: 'BROOKLYN',
510  89734: 'NEW YORK',
511  93990: 'NEW YORK',
512  99407: 'JAMAICA',
513  99847: 'NEW YORK',
514  100073: 'NEW YORK',
515  101013: 'NEW YORK',
516  104020: 'JAMAICA',
517  106118: 'NEW YORK',
518  106499: 'EAST ELMHURST'},
519 'Landmark': {2869: 'BARCLAYS CENTER',
520  23571: 'CENTRAL PARK',
521  41625: 'J F K AIRPORT',
522  44331: 'J F K AIRPORT',
523  46913: 'BARTEL PRITCHARD SQUARE',
524  47459: 'CITY COLLEGE',
525  48465: 'PS 37',
526  51837: 'JACKIE ROBINSON PARK',
527  51848: 'JACKIE ROBINSON PARK',
528  54089: 'CENTRAL PARK',
529  54343: 'UNION SQUARE PARK',
530  55140: 'WORLDS FAIR MARINA',
531  57789: 'LA GUARDIA AIRPORT',
532  63119: 'J F K AIRPORT',
533  66242: 'LA GUARDIA AIRPORT',
534  66758: 'BRYANT PARK',
535  66786: 'BETH ISRAEL MED CENTER',
536  66809: 'J F K AIRPORT',
537  67465: 'QUEENS COLLEGE',
538  72424: 'BARCLAYS CENTER',
539  75531: 'CENTRAL PARK',
540  77918: 'CENTRAL PARK',
541  78048: 'LA GUARDIA AIRPORT',
542  78352: 'BARCLAYS CENTER',
543  78383: 'WORLDS FAIR MARINA',
544  79078: 'WASHINGTON SQUARE PARK',
545  84489: 'PROSPECT PARK',
546  84518: 'PROSPECT PARK',
547  84688: 'PROSPECT PARK',
548  84695: 'PROSPECT PARK',
549  88812: 'J F K AIRPORT',
550  89205: 'CENTRAL PARK',
551  89382: 'GRAND ARMY PLAZA',
552  89734: 'BRYANT PARK',
553  93990: 'BETH ISRAEL MED CENTER',
554  99407: 'J F K AIRPORT',
555  99847: 'PORT AUTH 42 STREET',
556  100073: 'MUSEUM NATURAL HIST',
557  101013: 'GRAND CENTRAL TERM',
558  104020: 'JFK',
559  106118: 'CENTRAL PARK',
560  106499: 'LA GUARDIA AIRPORT'},
561 'Status': {2869: 'Closed',
562  23571: 'Closed',
563  41625: 'Closed',
564  44331: 'Closed',
565  46913: 'Closed',
566  47459: 'Closed',
567  48465: 'Closed',
568  51837: 'Closed',
569  51848: 'Closed',
570  54089: 'Closed',
571  54343: 'Closed',
572  55140: 'Closed',
573  57789: 'Closed',
574  63119: 'Closed',
575  66242: 'Closed',
576  66758: 'Closed',
577  66786: 'Closed',
578  66809: 'Closed',
579  67465: 'Closed',
580  72424: 'Closed',
581  75531: 'Closed',
582  77918: 'Closed',
583  78048: 'Closed',
584  78352: 'Closed',
585  78383: 'Closed',
586  79078: 'Closed',
587  84489: 'Closed',
588  84518: 'Closed',
589  84688: 'Closed',
590  84695: 'Closed',
591  88812: 'Closed',
592  89205: 'Closed',
593  89382: 'Closed',
594  89734: 'Closed',
595  93990: 'Closed',
596  99407: 'Closed',
597  99847: 'Closed',
598  100073: 'Closed',
599  101013: 'Closed',
600  104020: 'Closed',
601  106118: 'Closed',
602  106499: 'Closed'},
603 'Borough': {2869: 'BROOKLYN',
604  23571: 'MANHATTAN',
605  41625: 'QUEENS',
606  44331: 'QUEENS',
607  46913: 'BROOKLYN',
608  47459: 'MANHATTAN',
609  48465: 'QUEENS',
610  51837: 'MANHATTAN',
611  51848: 'MANHATTAN',
612  54089: 'MANHATTAN',
613  54343: 'MANHATTAN',
614  55140: 'QUEENS',
615  57789: 'QUEENS',
616  63119: 'QUEENS',
617  66242: 'QUEENS',
618  66758: 'MANHATTAN',
619  66786: 'MANHATTAN',
620  66809: 'QUEENS',
621  67465: 'QUEENS',
622  72424: 'BROOKLYN',
623  75531: 'MANHATTAN',
624  77918: 'MANHATTAN',
625  78048: 'QUEENS',
626  78352: 'BROOKLYN',
627  78383: 'QUEENS',
628  79078: 'MANHATTAN',
629  84489: 'BROOKLYN',
630  84518: 'BROOKLYN',
631  84688: 'BROOKLYN',
632  84695: 'BROOKLYN',
633  88812: 'QUEENS',
634  89205: 'MANHATTAN',
635  89382: 'BROOKLYN',
636  89734: 'MANHATTAN',
637  93990: 'MANHATTAN',
638  99407: 'QUEENS',
639  99847: 'MANHATTAN',
640  100073: 'MANHATTAN',
641  101013: 'MANHATTAN',
642  104020: 'QUEENS',
643  106118: 'MANHATTAN',
644  106499: 'QUEENS'}}
645for c in ['Created Date', 'Closed Date']:
646    df[c] = pd.to_datetime(df[c])
647    #df[c+'_date'] = df[c].dt.date # to extract the date (for created + closed)
648    #df[c+'_time'] = df[c].dt.time # to extract the time (for created + closed)
649df['difference in time'] = (df['Closed Date'] - df['Created Date']).astype('timedelta64[h]')
650print(df.groupby('Complaint Type').agg({'difference in time':'mean'}))
651

returns:

1Unnamed: 0     Created Date             Closed Date            Agency   Agency Name  Complaint Type Descriptor  Location Type   Incident Zip    Address Type    City    Landmark    Status  Borough
22869    2869    10/30/2013 09:14:47 AM  10/30/2013 10:48:51 AM  NYPD    New York City Police Department Illegal Parking Double Parked Blocking Traffic  Street/Sidewalk 11217.0 PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
323571   23571   10/25/2013 02:33:54 PM  10/25/2013 03:36:36 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
441625   41625   10/22/2013 09:33:56 PM  10/24/2013 05:37:24 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
544331   44331   10/22/2013 07:25:35 AM  10/25/2013 10:40:35 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
646913   46913   10/21/2013 05:03:26 PM  10/23/2013 09:59:23 AM  DPR Department of Parks and Recreation  Dead Tree   Dead/Dying Tree Street  11215   PLACENAME   BROOKLYN    BARTEL PRITCHARD SQUARE Closed  BROOKLYN
747459   47459   10/21/2013 02:56:08 PM  10/29/2013 06:17:10 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10031   PLACENAME   NEW YORK    CITY COLLEGE    Closed  MANHATTAN
848465   48465   10/21/2013 10:44:10 AM  10/21/2013 11:17:47 AM  NYPD    New York City Police Department Illegal Parking Posted Parking Sign Violation   Street/Sidewalk 11434   PLACENAME   JAMAICA PS 37   Closed  QUEENS
951837   51837   10/20/2013 04:36:12 PM  10/20/2013 06:35:49 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1051848   51848   10/20/2013 04:26:03 PM  10/20/2013 06:34:47 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10031.0 PLACENAME   NEW YORK    JACKIE ROBINSON PARK    Closed  MANHATTAN
1154089   54089   10/19/2013 03:45:47 PM  10/19/2013 04:10:11 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
1254343   54343   10/19/2013 01:27:43 PM  10/28/2013 08:42:12 AM  DOT Department of Transportation    Street Condition    Rough, Pitted or Cracked Roads  Street  10003.0 PLACENAME   NEW YORK    UNION SQUARE PARK   Closed  MANHATTAN
1355140   55140   10/19/2013 02:02:28 AM  10/19/2013 02:19:55 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368.0 PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
1457789   57789   10/18/2013 11:55:44 AM  10/23/2013 02:42:14 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1563119   63119   10/17/2013 06:52:37 AM  10/25/2013 06:49:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
1666242   66242   10/16/2013 01:56:24 PM  10/22/2013 03:09:11 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
1766758   66758   10/16/2013 11:52:43 AM  10/16/2013 04:35:34 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
1866786   66786   10/16/2013 11:42:23 AM  10/18/2013 04:57:04 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Insurance Information Requested Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
1966809   66809   10/16/2013 11:36:54 AM  10/16/2013 12:34:23 PM  NYPD    New York City Police Department Traffic Congestion/Gridlock Street/Sidewalk 11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
2067465   67465   10/16/2013 09:14:35 AM  10/16/2013 12:43:06 PM  NYPD    New York City Police Department Traffic Drag Racing Street/Sidewalk 11367   PLACENAME   FLUSHING    QUEENS COLLEGE  Closed  QUEENS
2172424   72424   10/15/2013 12:22:00 AM  10/21/2013 12:16:15 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2275531   75531   10/14/2013 10:59:20 AM  10/14/2013 03:09:51 PM  NYPD    New York City Police Department Vending In Prohibited Area  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2377918   77918   10/13/2013 03:16:03 PM  10/13/2013 03:25:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
2478048   78048   10/13/2013 01:06:02 PM  10/21/2013 10:20:21 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11369   PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
2578352   78352   10/13/2013 05:14:33 AM  10/16/2013 01:42:42 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11217   PLACENAME   BROOKLYN    BARCLAYS CENTER Closed  BROOKLYN
2678383   78383   10/13/2013 03:50:02 AM  10/13/2013 05:03:13 AM  NYPD    New York City Police Department Noise - Vehicle Car/Truck Music Street/Sidewalk 11368   PLACENAME   CORONA  WORLDS FAIR MARINA  Closed  QUEENS
2779078   79078   10/12/2013 09:53:17 PM  10/13/2013 02:52:07 AM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10011   PLACENAME   NEW YORK    WASHINGTON SQUARE PARK  Closed  MANHATTAN
2884489   84489   10/10/2013 07:16:16 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
2984518   84518   10/10/2013 07:02:29 PM  10/10/2013 10:29:16 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3084688   84688   10/10/2013 05:39:19 PM  10/10/2013 10:29:17 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3184695   84695   10/10/2013 05:37:04 PM  10/10/2013 10:30:19 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 11215   PLACENAME   BROOKLYN    PROSPECT PARK   Closed  BROOKLYN
3288812   88812   10/09/2013 09:17:15 PM  10/23/2013 02:15:21 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  11430   PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3389205   89205   10/09/2013 06:01:48 PM  10/09/2013 09:04:26 PM  NYPD    New York City Police Department Vending Unlicensed  Park/Playground 10000   PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
3489382   89382   10/09/2013 04:53:01 PM  10/18/2013 08:35:02 AM  DOT Department of Transportation    Public Toilet   Damaged Door    Sidewalk    11238   PLACENAME   BROOKLYN    GRAND ARMY PLAZA    Closed  BROOKLYN
3589734   89734   10/09/2013 03:13:23 PM  10/09/2013 05:10:45 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10036   PLACENAME   NEW YORK    BRYANT PARK Closed  MANHATTAN
3693990   93990   10/08/2013 06:14:15 PM  10/09/2013 04:00:59 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10003   PLACENAME   NEW YORK    BETH ISRAEL MED CENTER  Closed  MANHATTAN
3799407   99407   10/07/2013 03:56:11 PM  10/08/2013 07:04:14 AM  DPR Department of Parks and Recreation  Overgrown Tree/Branches Traffic Sign or Signal Blocked  Street  11430.0 PLACENAME   JAMAICA J F K AIRPORT   Closed  QUEENS
3899847   99847   10/07/2013 02:33:21 PM  10/09/2013 02:36:42 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10036.0 PLACENAME   NEW YORK    PORT AUTH 42 STREET Closed  MANHATTAN
39100073  100073  10/07/2013 01:36:02 PM  10/09/2013 09:56:55 AM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10024.0 PLACENAME   NEW YORK    MUSEUM NATURAL HIST Closed  MANHATTAN
40101013  101013  10/07/2013 10:05:18 AM  10/09/2013 03:36:23 PM  TLC Taxi and Limousine Commission   Taxi Complaint  Driver Complaint    Street  10017.0 PLACENAME   NEW YORK    GRAND CENTRAL TERM  Closed  MANHATTAN
41104020  104020  10/06/2013 02:58:47 PM  10/07/2013 12:11:16 PM  TLC Taxi and Limousine Commission   For Hire Vehicle Complaint  Car Service Company Complaint   Street  11430.0 PLACENAME   JAMAICA JFK Closed  QUEENS
42106118  106118  10/05/2013 03:24:47 PM  10/05/2013 04:20:34 PM  NYPD    New York City Police Department Noise - Park    Loud Music/Party    Park/Playground 10000.0 PLACENAME   NEW YORK    CENTRAL PARK    Closed  MANHATTAN
43106499  106499  10/05/2013 11:52:13 AM  10/07/2013 08:00:28 AM  DOT Department of Transportation    Public Toilet   Dirty/Graffiti  Sidewalk    11369.0 PLACENAME   EAST ELMHURST   LA GUARDIA AIRPORT  Closed  QUEENS
44pd.Timedelta(task3['Closed Date'] - task3['Created Date']).seconds / 60.0
45                         mean                   count
46complaint Type           closing_time_hours     closing_time_hours
47Blocked Driveway         3.00                   4581
48DOF Literature Request   30.16                  5481
49General Construction     66.38                  798
50Heating                  54.88                  6704
51Illegal Parking          3.08                   3336
52Nonconst                 65                     100 
53Paint-Plaster            49                     3281 
54Plumbing                 65                     666   
55Strret Condition         81                     2610    
56Street Light Condition   90                     4207
57{'Unnamed: 0': {2869: 2869,
58  23571: 23571,
59  41625: 41625,
60  44331: 44331,
61  46913: 46913,
62  47459: 47459,
63  48465: 48465,
64  51837: 51837,
65  51848: 51848,
66  54089: 54089,
67  54343: 54343,
68  55140: 55140,
69  57789: 57789,
70  63119: 63119,
71  66242: 66242,
72  66758: 66758,
73  66786: 66786,
74  66809: 66809,
75  67465: 67465,
76  72424: 72424,
77  75531: 75531,
78  77918: 77918,
79  78048: 78048,
80  78352: 78352,
81  78383: 78383,
82  79078: 79078,
83  84489: 84489,
84  84518: 84518,
85  84688: 84688,
86  84695: 84695,
87  88812: 88812,
88  89205: 89205,
89  89382: 89382,
90  89734: 89734,
91  93990: 93990,
92  99407: 99407,
93  99847: 99847,
94  100073: 100073,
95  101013: 101013,
96  104020: 104020,
97  106118: 106118,
98