尝试使用Pandas数据帧的前23行作为标头,然后围绕标头旋转

2024-05-19 00:00:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用tabla拉入数据框。不幸的是,数据按行排列,如下所示。我需要获取前23行,并将它们用作剩余数据的列标题。我需要每行包含这23个标题,每个标题对应大约60个诊所

                                         Col  \
0                                       Date   
1                                     Clinic   
2                                   Location   
3                             Clinic Manager   
4                                 Lease Cost   
5                             Square Footage   
6                           Lease Expiration   
8                              Care Provided   
9                 # of Providers (Full Time)   
10                    # FTE's Providing Care   
11                   # Providers (Part-Time)   
12                    Patients seen per week   
13  Number of patients in rooms per provider   
14        Number of patients in waiting room   
15                              # Exam Rooms   
16                           Procedure rooms   
17                               Other rooms   
18                             Specify other   
20                               Other data:   
21                                 TI Needs:   
23              Conclusion  & Recommendation   
24                                      Date   
25                                    Clinic   
26                                  Location   
27                            Clinic Manager   
28                                Lease Cost   
29                            Square Footage   
30                          Lease Expiration   
32                             Care Provided   
33                # of Providers (Full Time)   
34                    # FTE's Providing Care   
35                   # Providers (Part-Time)   
36                    Patients seen per week   
37  Number of patients in rooms per provider   
38        Number of patients in waiting room   
39                              # Exam Rooms   
40                           Procedure rooms   
41                               Other rooms   
42                             Specify other   
44                               Other data:   
45                                 TI Needs:   
47              Conclusion  & Recommendation   

                                                  Val  
0                                           9/13/2017  
1                                 Gray Medical Center  
2                 1234 E. 164th Ave Thornton CA 12345  
3                                            Jane Doe  
4                      $23,074.80 Rent, $5,392.88 CAM  
5                                               9,840  
6                                           7/31/2023  
8                                     Family Medicine  
9                                                  12  
10                                                 14  
11                                                  1  
12                                                750  
13                                                  4  
14                                                  2  
15                                                 31  
16                                                  1  
17                     X-Ray, Phlebotomist/blood draw  
18                                                NaN  
20  Facilities assistance needed.  50% of business...  
21  Paint and Carpet (flooring is in good conditio...  
23  Lay out and occupancy flow are good for this p...  
24                                          9/13/2017  
25                                    Main Cardiology  
26               12000 Wall St Suite 13 Main CA 12345  
27                                           John Doe  
28                       $9610.42 Rent, $2,937.33 CAM  
29                                              4,406  
30                                          5/31/2024  
32                                         Cardiology  
33                                                  2  
34                                       11, 2 - P.T.  
35                                                  2  
36                                                188  
37                                                  0  
38                                                  2  
39                                                  6  
40                                                  0  
41  1 - Pacemaker, 1 - Treadmill, 1- Echo, 1 - Ech...  
42  Nurse Office, MA station, Reading Room, 2 Phys...  
44  Occupied in Emerus building. Needs facilities ...  
45                    New build out, great condition.  
47  Practice recently relocated from 84th and Alco...  

通过修复标题,我能够将数据帧放在更好的位置。我将重新发布前3组数据,以更好地说明数据框架的结构。对于每个诊所,所有内容都会重复(标题和值)


Tags: of数据in标题numbertimeotherclinic

热门问题