我正在尝试一个数据框,当前我是从一个已经存在的数据框中获取值。 行“数据,如下所示:
01 03 55 55 55 55 55 55
并且我想将每个这些值分开;
但是d1变成3而不是1,如附图所示。
row ['data']是图片中该数据框中的值;
data = StringIO(row['data'])
df_data = pd.read_csv(data, delimiter=' ', names=['d1', 'd2', 'd3', 'd4', 'd5', 'd6',
'd7', 'd8'])
我也尝试使用read_table,但结果相同
答案 0 :(得分:0)
如果它是public class RegisterViewModel
{
private readonly DataService dataService = new DataService();
public string Email { get; set; }
public string Password { get; set; }
public string ConfirmPassword { get; set; }
public string Message { get; set; }
public ICommand RegisterCommand
{
get
{
return new Command(async () =>
{
var isRegistered = await dataService.RegisterUserAsync(Email, Password, ConfirmPassword);
Settings.Username = Email;
Settings.Password = Password;
if (isRegistered)
{
//DisplayAlert( "Alert" , "Registered", "OK");
//Message = "Registered Successfully :)";
// DependencyService.Get<Toast>().Show("You have registered succefully");
Application.Current.MainPage = new NavigationPage(new EntryPage());
}
else
{
Message = " Retry Later :(";
}
});
}
}
}
文件,则可以使用:
.csv
答案 1 :(得分:0)
使用以下内容:
df = pd.read_csv(filename, delimiter=' ', names=['d1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8'], index_col=False)