从数据框创建数据框(Create a dataframe from a dataframe)
我想从之前创建的数据框中创建一个数据框。 我的第一个数据框是:
Sample motif chromosome 1 CT-G.A 1 1 TA-C.C 1 1 TC-G.C 2 2 CG-A.T 2 2 CA-G.T 2
然后,我想创建一个如下所示的数据框(96 * 24-基序*染色体):
Sample CT-G.A,chr1 TA-C.C,chr1 TC-G.C,chr1 CG-A.T,ch1 CA-G.T,ch1 CT-G.A,chr2 TA-C.C,chr2 TC-G.C,chr2 CG-A.T,ch2 CA-G.T,ch2 1 1 1 0 0 0 0 0 1 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 1 1
I'd like to create a dataframe from a dataframe that created before. my first dataframe is:
Sample motif chromosome 1 CT-G.A 1 1 TA-C.C 1 1 TC-G.C 2 2 CG-A.T 2 2 CA-G.T 2
Then I want to create a dataframe like below, for all (96*24-motifs*chromosomes-):
Sample CT-G.A,chr1 TA-C.C,chr1 TC-G.C,chr1 CG-A.T,ch1 CA-G.T,ch1 CT-G.A,chr2 TA-C.C,chr2 TC-G.C,chr2 CG-A.T,ch2 CA-G.T,ch2 1 1 1 0 0 0 0 0 1 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 1 1
原文:https://stackoverflow.com/questions/48607092
满意答案
如果您选择使用
SINGLE_TABLE
继承(这是代码中没有参数的@Inheritance
注释的默认值),那么您应该将@DiscriminatorColumn
注释添加到您的超类(和@DiscriminatorValue
以扩展类)。 否则通过文档 :如果未在实体层次结构的根目录中指定@DiscriminatorColumn且需要鉴别器列,则持久性提供程序假定默认列名为DTYPE,列类型为DiscriminatorType.STRING。
hibernate只是在你的表中找不到这个默认列。 您可以引入自己的descriminator列,或生成默认列
If you choose to use
SINGLE_TABLE
inheritance (which is default for@Inheritance
annotation without arguments in your code) then you should add@DiscriminatorColumn
annotation to your superclass (and@DiscriminatorValue
to extending classes). Otherwise via documentation:If @DiscriminatorColumn is not specified on the root of the entity hierarchy and a discriminator column is required, the Persistence provider assumes a default column name of DTYPE and column type of DiscriminatorType.STRING.
hibernate just can't find this default column in your table. You can introduce your own descriminator column, or generate default one
相关问答
更多你如何像在Symfony 1中一样在Symfony 2中扩展一个实体?(How do you extend an entity in Symfony2 like you used to be able to in Symfony 1?)
将实体框架保存在单个实体类型上(Extend Entity Framework Save on a single Entity Type)
当子类只有@Transient字段时扩展@Entity的最佳方法(The best way to extend an @Entity when the subclass has just a @Transient field besides)
如何扩展核心数据实体类(How to extend core data entity classes)
无法扩展未映射的类:实体(Cannot extend unmapped class: Entity)
我们可以从@Embedded类扩展@Entity类(Can we extends @Entity class from @Embedded class)
如何扩展Entity Framework 6模型(How to extend an Entity Framework 6 model)
如何扩展@Entity(How to extend an @Entity)
插入扩展抽象实体的实体时出错(Error when inserting entities which extend an Abstract Entity)
如何扩展Entity Framework 6.1.3生成的类?(How to extend an Entity Framework 6.1.3 generated class?)
相关文章
更多Becoming a data scientist
She’s Not Carrying A Handbag
ServletOutputStream cannot be resolved to a type
Create a Bootable MicroSD Card
Book Report: THE SOUL OF A NEW MACHINE
Solr: a custom Search RequestHandler
A Great List of Windows Tools
How to Start a Business in 10 Days
Spring Data: a new perspective of data operations
Drupal Forums instead of phpBB or vBulletin: A casestudy
最新问答
更多sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
湖北京山哪里有修平板计算机的
SimplePie问题(SimplePie Problem)
在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)
HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)
为什么我会收到链接错误?(Why do I get a linker error?)
如何正确定义析构函数(How to properly define destructor)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!