python - 使用 pandas pd.concat 后丢失的列
问题描述
我尝试使用以下代码组合两个数据框:
df1=pd.read_csv('NBA_2010_new.csv',encoding='ISO-8859-1')
df2=pd.read_csv('NBA_2011.csv',encoding='ISO-8859-1')
frames = [df1,df2]
combine = pd.concat(frames,axis=0,ignore_index=True,join='inner')
df=combine.reset_index(drop = True)
df.index += 1
CSV 文件最初包含 26 列..但是当我尝试使用 df.info() 查看 df 时...它只显示 22 列,有些列丢失了....
解决方案
推荐阅读
- c++ - websocketpp 连接失败,asio.system 错误代码 10057
- python - 按特定索引值过滤具有 MultiIndex 的数据帧
- python - 这个 Python 代码有什么问题?权限错误:[Errno 13]
- javascript - 这个 Typescript 语法是什么意思
- laravel - 不同的用户类型表 laravel
- llvm - LLVM 函数提升最佳方法
- sql - 连接两个表,使外键列数据(整数)更改为父表中的文本数据(父表中的相关列不是主键)
- gnuplot - Gnuplot:使用调色板时数据点的透明度
- javascript - 在 wordpress 网站上使用 javascript 添加/修改链接
- amazon-web-services - terraform 在分区方面如何处理安装 AWS Elastic Block Store (EBS)?