首页 > 解决方案 > 如何连接以下数据框

问题描述

我有两个数据框:

file_date = str((date.today() - timedelta(days = 2)).strftime('%m-%d-%Y'))
file_date

github_dir_path = ' https://github.com/CSSEGISandData/COVID-19/raw/master/csse_covid_19_data/csse_covid_19_daily_reports/ ' file_path = github_dir_path + file_date + '.csv' 第一个数据帧:

  FIPS     Admin2     Province_State Country_Region          Last_Update        Lat       Long_  Confirmed  Deaths  Recovered  Active                   Combined_Key
0     45001.0  Abbeville     South Carolina             US  2020-04-28 02:30:51  34.223334  -82.461707         29       0          0      29  Abbeville, South Carolina, US
1     22001.0     Acadia          Louisiana             US  2020-04-28 02:30:51  30.295065  -92.414197        130       9          0     121          Acadia, Louisiana, US
2     51001.0   Accomack           Virginia             US  2020-04-28 02:30:51  37.767072  -75.632346        195       3          0     192         Accomack, Virginia, US
3     16001.0        Ada              Idaho             US  2020-04-28 02:30:51  43.452658 -116.241552        650      15          0     635                 Ada, Idaho, US
4     19001.0      Adair               Iowa             US  2020-04-28 02:30:51  41.330756  -94.471059          1       0          0       1                Adair, Iowa, US
#
                            0                          0  ...          0         Kerala       0         Kerala       1
2     2020-02-01             Kerala                                        2                                           0                          0  ...          0         Kerala       0         Kerala       2
3     2020-02-02             Kerala                                        3                                           0                          0  ...          0         Kerala       0         Kerala       3
4     2020-02-03             Kerala                                        3                                           0                          0  ...          0         Kerala       0         Kerala       3

请指导我如何连接两个数据框。我尝试了几件事,但没有得到预期的结果。

标签: pythonpython-3.xpandas

解决方案


推荐阅读