使用df_dict2 = pd.read_fwf(io.stringio(read_data),delim_whitespace = true)时问题
问题:从字符串加载数据框时,称为read_data如下:
导入pandas为pd 导入IO read_data =“”“操作应用描述
说明详细信息名称 关联 Statm工作在居住状态 统计 Bytes 0字节总数大小 滴入0的学生数量 兰斯 lanst"""
df = pd.read_fwf(io.StringIO(read_data), delim_whitespace=True)
the output as shown in the attached image. The main issue for words "stats" and "lans" the last s got removed when the df创建
Issue: when loading data frame from string CALLED read_data as follow:
import pandas as pd
import io
read_data = """ operational applied description
description Details names
link
statm working The state of the residenat
stats
in-bytes 0 Bytes Total number size
in-drops 0 Number of student drop
lans
lanst"""
df = pd.read_fwf(io.StringIO(read_data), delim_whitespace=True)
the output as shown in the attached image. The main issue for words "stats" and "lans" the last s got removed when the df created
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论