问:
AttributeError: type object 'object' has no attribute 'dtype' when creating a new dataframe based on two other dataframes
I want to create a new dataframe df_rest based on two other dataframes exon_rna and clin_kipan by retaining the rows of exon_rna with indices unique from clin_kipan.

```<code>df_rest = pd.DataFrame(index=list( set( exon_rna.index.tolist()) - set( clin_kipan.index.tolist()) ), columns=clin_kipan.columns)
</code>```

Traceback:

```<code>---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [5], in <cell line: 1>()
----> 1 df_rest = pd.DataFrame(index=list( set( exon_rna.index.tolist()) - set( clin_kipan.index.tolist()) ), columns=clin_kipan.columns)
      2 df_rest

File /usr/lib/python3/dist-packages/pandas/core/frame.py:411, in DataFrame.__init__(self, data, index, columns, dtype, copy)
    407     mgr = self._init_mgr(
    408         data, axes=dict(index=index, columns=columns), dtype=dtype, copy=copy
    409     )
    410 elif isinstance(data, dict):
--> 411     mgr = init_dict(data, index, columns, dtype=dtype)
    412 elif isinstance(data, ma.MaskedArray):
    413     import numpy.ma.mrecords as mrecords

File /usr/lib/python3/dist-packages/pandas/core/internals/construction.py:242, in init_dict(data, index, columns, dtype)
    240         else:
    241             nan_dtype = dtype
--> 242         val = construct_1d_arraylike_from_scalar(np.nan, len(index), nan_dtype)
    243         arrays.loc[missing] = [val] * missing.sum()
    245 else:

File /usr/lib/python3/dist-packages/pandas/core/dtypes/cast.py:1229, in construct_1d_arraylike_from_scalar(value, length, dtype)
   1227 else:
   1228     if not isinstance(dtype, (np.dtype, type(np.dtype))):
-> 1229         dtype = dtype.dtype
   1231     if length and is_integer_dtype(dtype) and isna(value):
   1232         # coerce if we have nan for an integer dtype
   1233         dtype = np.dtype("float64")

AttributeError: type object 'object' has no attribute 'dtype'
</code>```

Data:

exon_rna.head()

```pd.DataFrame({'chr1:11874-12227:+': {'TCGA-2K-A9WE-01A': '0.15591837759944',
  'TCGA-2Z-A9J1-01A': '0.2719547'},
 'chr1:12595-12721:+': {'TCGA-2K-A9WE-01A': '0.24834693214939',
  'TCGA-2Z-A9J1-01A': '0.7301587'},
 'chr1:12613-12721:+': {'TCGA-2K-A9WE-01A': '0.289358352137362',
  'TCGA-2Z-A9J1-01A': '0.8518519'},
 'chr1:12646-12697:+': {'TCGA-2K-A9WE-01A': '0.454904717062103',
  'TCGA-2Z-A9J1-01A': '0.8823529'},
 'chr1:13221-14409:+': {'TCGA-2K-A9WE-01A': '0.954955570888991',
  'TCGA-2Z-A9J1-01A': '0.6026936'},
 'chr1:13403-14409:+': {'TCGA-2K-A9WE-01A': '1.02575668077691',
  'TCGA-2Z-A9J1-01A': '0.6272366'},
 'chr1:14363-16765:-': {'TCGA-2K-A9WE-01A': '13.7323296611257',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:16854-17055:-': {'TCGA-2K-A9WE-01A': '33.8431093465806',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:17233-18061:-': {'TCGA-2K-A9WE-01A': '24.0355043992073',
  'TCGA-2Z-A9J1-01A': '0.9106280'},
 'chr1:18268-18379:-': {'TCGA-2K-A9WE-01A': '39.6362812402087',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:18497-18554:-': {'TCGA-2K-A9WE-01A': '16.5857214082873',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:18913-19759:-': {'TCGA-2K-A9WE-01A': '12.3069539038635',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:24738-24901:-': {'TCGA-2K-A9WE-01A': '11.683284562595',
  'TCGA-2Z-A9J1-01A': '0.9570552'},
 'chr1:29321-29370:-': {'TCGA-2K-A9WE-01A': '1.57700301914863',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:29824-29961:-': {'TCGA-2K-A9WE-01A': '0.628515696037495',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:34612-35174:-': {'TCGA-2K-A9WE-01A': '0.0280107108196914',
  'TCGA-2Z-A9J1-01A': '0.1708185'},
 'chr1:35277-35481:-': {'TCGA-2K-A9WE-01A': '0.115390464815753',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:35721-36081:-': {'TCGA-2K-A9WE-01A': '0.0218421470796208',
  'TCGA-2Z-A9J1-01A': '0.1333333'},
 'chr1:69091-70008:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:89295-90404:-': {'TCGA-2K-A9WE-01A': '1.05133534609908',
  'TCGA-2Z-A9J1-01A': '0.7772768'},
 'chr1:137839-139228:-': {'TCGA-2K-A9WE-01A': '9.20107516927723',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:236615-237877:-': {'TCGA-2K-A9WE-01A': '1.38596464865794',
  'TCGA-2Z-A9J1-01A': '0.9928685'},
 'chr1:321084-321114:+': {'TCGA-2K-A9WE-01A': '21.3658473562072',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:321146-321223:+': {'TCGA-2K-A9WE-01A': '11.3220729579901',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:322037-322228:+': {'TCGA-2K-A9WE-01A': '2.87474508698968',
  'TCGA-2Z-A9J1-01A': '0.9790576'},
 'chr1:323892-324060:+': {'TCGA-2K-A9WE-01A': '2.84607053751675',
  'TCGA-2Z-A9J1-01A': '0.9702381'},
 'chr1:324288-324345:+': {'TCGA-2K-A9WE-01A': '0.407845608400506',
  'TCGA-2Z-A9J1-01A': '0.6842105'},
 'chr1:324439-328580:+': {'TCGA-2K-A9WE-01A': '9.23471951459437',
  'TCGA-2Z-A9J1-01A': '0.9801980'},
 'chr1:367659-368595:+': {'TCGA-2K-A9WE-01A': '0.0252455125797539',
  'TCGA-2Z-A9J1-01A': '0.1463675'},
 'chr1:420206-420296:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:420992-421258:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:421396-421839:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0767494'},
 'chr1:566462-568045:+': {'TCGA-2K-A9WE-01A': '5202.77588235356',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:568149-568842:+': {'TCGA-2K-A9WE-01A': '869.021829435309',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:568844-568912:+': {'TCGA-2K-A9WE-01A': '30.6258557341907',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:569327-570349:+': {'TCGA-2K-A9WE-01A': '3388.6912187813',
  'TCGA-2Z-A9J1-01A': '0.9608610'},
 'chr1:621098-622034:-': {'TCGA-2K-A9WE-01A': '0.0252455125797539',
  'TCGA-2Z-A9J1-01A': '0.1452992'},
 'chr1:661140-665184:-': {'TCGA-2K-A9WE-01A': '9.40353839848327',
  'TCGA-2Z-A9J1-01A': '0.9985163'},
 'chr1:665278-665335:-': {'TCGA-2K-A9WE-01A': '4.75819876467258',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:665563-665731:-': {'TCGA-2K-A9WE-01A': '2.8927274315744',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:667397-667587:-': {'TCGA-2K-A9WE-01A': '4.29341136103291',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:668402-668479:-': {'TCGA-2K-A9WE-01A': '12.9395119519887',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:668511-668541:-': {'TCGA-2K-A9WE-01A': '24.6724665899059',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:668687-668744:-': {'TCGA-2K-A9WE-01A': '8.83665484867764',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:670803-670994:-': {'TCGA-2K-A9WE-01A': '5.05133779571044',
  'TCGA-2Z-A9J1-01A': '0.9947644'},
 'chr1:671808-671885:-': {'TCGA-2K-A9WE-01A': '8.18828490711786',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:671917-671947:-': {'TCGA-2K-A9WE-01A': '13.4808322604641',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:674240-674404:-': {'TCGA-2K-A9WE-01A': '6.40358801714896',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:675183-675415:-': {'TCGA-2K-A9WE-01A': '7.4789198976791',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:675509-675566:-': {'TCGA-2K-A9WE-01A': '3.94250754787156',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:678666-678730:-': {'TCGA-2K-A9WE-01A': '3.88185358559662',
  'TCGA-2Z-A9J1-01A': '0.9375000'},
 'chr1:679575-679736:-': {'TCGA-2K-A9WE-01A': '1.99559024028067',
  'TCGA-2Z-A9J1-01A': '0.8322982'},
 'chr1:700237-700627:-': {'TCGA-2K-A9WE-01A': '0.867149997741571',
  'TCGA-2Z-A9J1-01A': '0.9025641'},
 'chr1:701709-701767:-': {'TCGA-2K-A9WE-01A': '1.60373188387996',
  'TCGA-2Z-A9J1-01A': '0.9655172'},
 'chr1:703928-703993:-': {'TCGA-2K-A9WE-01A': '5.61508650757465',
  'TCGA-2Z-A9J1-01A': '0.9076923'},
 'chr1:704877-705092:-': {'TCGA-2K-A9WE-01A': '2.3728054686264',
  'TCGA-2Z-A9J1-01A': '0.8465116'},
 'chr1:708356-708487:-': {'TCGA-2K-A9WE-01A': '1.79204888539616',
  'TCGA-2Z-A9J1-01A': '0.7557252'},
 'chr1:709551-709660:-': {'TCGA-2K-A9WE-01A': '4.1575534141191',
  'TCGA-2Z-A9J1-01A': '0.7706422'},
 'chr1:713664-714006:-': {'TCGA-2K-A9WE-01A': '0.873558523726644',
  'TCGA-2Z-A9J1-01A': '0.7339181'},
 'chr1:761587-762902:-': {'TCGA-2K-A9WE-01A': '1.17436395042983',
  'TCGA-2Z-A9J1-01A': '0.9749050'},
 'chr1:763064-763155:+': {'TCGA-2K-A9WE-01A': '1.45701365899601',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:764383-764484:+': {'TCGA-2K-A9WE-01A': '2.24181801741716',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:783034-783186:+': {'TCGA-2K-A9WE-01A': '1.59761743769959',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:787307-787490:+': {'TCGA-2K-A9WE-01A': '3.08544068963861',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:788051-788146:+': {'TCGA-2K-A9WE-01A': '4.5174565652695',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:788771-789740:+': {'TCGA-2K-A9WE-01A': '4.65784912356785',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:791898-794579:+': {'TCGA-2K-A9WE-01A': '0.711474143612914',
  'TCGA-2Z-A9J1-01A': '0.9492726'},
 'chr1:803453-804055:-': {'TCGA-2K-A9WE-01A': '1.22917316583724',
  'TCGA-2Z-A9J1-01A': '0.9269103'},
 'chr1:809492-810535:-': {'TCGA-2K-A9WE-01A': '0.0302107858074449',
  'TCGA-2Z-A9J1-01A': '0.1639501'},
 'chr1:812126-812182:-': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.8214286'},
 'chr1:846815-846853:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:847325-850328:+': {'TCGA-2K-A9WE-01A': '0.0262483858047374',
  'TCGA-2Z-A9J1-01A': '0.0799201'},
 'chr1:852953-853100:-': {'TCGA-2K-A9WE-01A': '1.2253739675817',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:853402-853555:-': {'TCGA-2K-A9WE-01A': '0.921625141060885',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:854205-854295:-': {'TCGA-2K-A9WE-01A': '1.03978221042766',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:854715-854817:-': {'TCGA-2K-A9WE-01A': '0.382767723094326',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:860530-860569:+': {'TCGA-2K-A9WE-01A': '0.394250754787156',
  'TCGA-2Z-A9J1-01A': '0.7948718'},
 'chr1:861121-861180:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.1864407'},
 'chr1:861302-861393:+': {'TCGA-2K-A9WE-01A': '0.599946800763064',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:865535-865716:+': {'TCGA-2K-A9WE-01A': '1.51634905687368',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:866419-866469:+': {'TCGA-2K-A9WE-01A': '2.00990580871884',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:871152-871276:+': {'TCGA-2K-A9WE-01A': '1.82932350221241',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:874420-874509:+': {'TCGA-2K-A9WE-01A': '2.7159496440893',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:874655-874840:+': {'TCGA-2K-A9WE-01A': '1.22938407406748',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:876524-876686:+': {'TCGA-2K-A9WE-01A': '1.35448112074115',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:877516-877631:+': {'TCGA-2K-A9WE-01A': '3.12681633107055',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:877790-877868:+': {'TCGA-2K-A9WE-01A': '2.39544762402323',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:877939-878438:+': {'TCGA-2K-A9WE-01A': '1.90817365316984',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:878633-878757:+': {'TCGA-2K-A9WE-01A': '5.61413074816911',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:879078-879188:+': {'TCGA-2K-A9WE-01A': '5.18564055846169',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:879288-879961:+': {'TCGA-2K-A9WE-01A': '16.7527323695907',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:879584-880180:-': {'TCGA-2K-A9WE-01A': '27.6569876222548',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:880422-880526:-': {'TCGA-2K-A9WE-01A': '47.4602813381872',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:880898-881033:-': {'TCGA-2K-A9WE-01A': '41.6862195135243',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:881553-881666:-': {'TCGA-2K-A9WE-01A': '36.2434027207842',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:881782-881925:-': {'TCGA-2K-A9WE-01A': '27.378524637997',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:883511-883612:-': {'TCGA-2K-A9WE-01A': '27.7521609742332',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:883870-883983:-': {'TCGA-2K-A9WE-01A': '30.9867259902888',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:886507-886618:-': {'TCGA-2K-A9WE-01A': '27.104739391617',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:887380-887519:-': {'TCGA-2K-A9WE-01A': '20.6136823217285',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:887792-887980:-': {'TCGA-2K-A9WE-01A': '17.3136574853619',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:888555-888668:-': {'TCGA-2K-A9WE-01A': '17.222532972281',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:889162-889272:-': {'TCGA-2K-A9WE-01A': '16.5514280838572',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:889384-889903:-': {'TCGA-2K-A9WE-01A': '3.88185358559662',
  'TCGA-2Z-A9J1-01A': '0.9672447'},
 'chr1:891303-891393:-': {'TCGA-2K-A9WE-01A': '16.549866849307',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:891475-891595:-': {'TCGA-2K-A9WE-01A': '19.2237971342498',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:892274-892405:-': {'TCGA-2K-A9WE-01A': '16.1284399685655',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:892479-894461:-': {'TCGA-2K-A9WE-01A': '2.43349936389047',
  'TCGA-2Z-A9J1-01A': '0.7462159'},
 'chr1:894595-894679:-': {'TCGA-2K-A9WE-01A': '8.16330974618112',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:895967-896180:+': {'TCGA-2K-A9WE-01A': '0.294766919467033',
  'TCGA-2Z-A9J1-01A': '0.6291080'},
 'chr1:896673-897130:+': {'TCGA-2K-A9WE-01A': '1.54945711488402',
  'TCGA-2Z-A9J1-01A': '0.9431072'},
 'chr1:897206-897858:+': {'TCGA-2K-A9WE-01A': '2.25803648224191',
  'TCGA-2Z-A9J1-01A': '0.9662577'},
 'chr1:898084-898297:+': {'TCGA-2K-A9WE-01A': '3.09505265440384',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:898412-899229:+': {'TCGA-2K-A9WE-01A': '1.9471553170417',
  'TCGA-2Z-A9J1-01A': '0.8470012'},
 'chr1:899300-899388:+': {'TCGA-2K-A9WE-01A': '6.29029294154789',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:899487-899560:+': {'TCGA-2K-A9WE-01A': '5.96703845083264',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:899729-899910:+': {'TCGA-2K-A9WE-01A': '4.15912884171066',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:900343-901095:+': {'TCGA-2K-A9WE-01A': '3.86397154094185',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:901877-901994:+': {'TCGA-2K-A9WE-01A': '1.47008756022329',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:902084-902183:+': {'TCGA-2K-A9WE-01A': '2.28665437776551',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:905657-905803:+': {'TCGA-2K-A9WE-01A': '1.5019076372844',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:905901-905981:+': {'TCGA-2K-A9WE-01A': '1.36284211531363',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:906066-906386:+': {'TCGA-2K-A9WE-01A': '1.08081203804579',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:906457-906588:+': {'TCGA-2K-A9WE-01A': '2.1504586624754',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:906704-906784:+': {'TCGA-2K-A9WE-01A': '2.33630076910907',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:907455-907530:+': {'TCGA-2K-A9WE-01A': '2.28250436982038',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:907668-907804:+': {'TCGA-2K-A9WE-01A': '2.58996846210541',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:908241-908390:+': {'TCGA-2K-A9WE-01A': '2.36550452872294',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:908566-908706:+': {'TCGA-2K-A9WE-01A': '2.23688371510443',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:908880-909020:+': {'TCGA-2K-A9WE-01A': '1.90135115783877',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:909213-909431:+': {'TCGA-2K-A9WE-01A': '2.37630591926505',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:909696-909744:+': {'TCGA-2K-A9WE-01A': '3.54021085931324',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:909822-910482:+': {'TCGA-2K-A9WE-01A': '1.57461723545854',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:910579-911649:-': {'TCGA-2K-A9WE-01A': '1.44300929856737',
  'TCGA-2Z-A9J1-01A': '0.9607477'},
 'chr1:911879-912021:-': {'TCGA-2K-A9WE-01A': '0.165419897113492',
  'TCGA-2Z-A9J1-01A': '0.8380282'},
 'chr1:914261-916037:-': {'TCGA-2K-A9WE-01A': '0.0665589344041344',
  'TCGA-2Z-A9J1-01A': '0.7162162'},
 'chr1:916517-916553:-': {'TCGA-2K-A9WE-01A': '0.213108516101166',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:917445-917473:-': {'TCGA-2K-A9WE-01A': '0.271897072267004',
  'TCGA-2Z-A9J1-01A': '0.7500000'},
 'chr1:934342-934812:-': {'TCGA-2K-A9WE-01A': '2.31025920002665',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:934906-934993:-': {'TCGA-2K-A9WE-01A': '13.3507641962014',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:935072-935552:-': {'TCGA-2K-A9WE-01A': '3.08187700207839',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:948847-948956:+': {'TCGA-2K-A9WE-01A': '29.3179197650813',
  'TCGA-2Z-A9J1-01A': '0.9449542'},
 'chr1:949364-949915:+': {'TCGA-2K-A9WE-01A': '35.9682391505094',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:955503-955753:+': {'TCGA-2K-A9WE-01A': '7.69652867911182',
  'TCGA-2Z-A9J1-01A': '0.7760000'},
 'chr1:957581-957842:+': {'TCGA-2K-A9WE-01A': '36.2650503449254',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:970657-970704:+': {'TCGA-2K-A9WE-01A': '39.2608043308876',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:976045-976260:+': {'TCGA-2K-A9WE-01A': '17.3762369702487',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:976553-976777:+': {'TCGA-2K-A9WE-01A': '10.5834424840641',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:976858-977082:+': {'TCGA-2K-A9WE-01A': '30.6989921060932',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:977336-977542:+': {'TCGA-2K-A9WE-01A': '40.9868417537179',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:978619-978837:+': {'TCGA-2K-A9WE-01A': '42.017409208823',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:978918-979112:+': {'TCGA-2K-A9WE-01A': '44.0752125864616',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:979203-979403:+': {'TCGA-2K-A9WE-01A': '46.3685962346685',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:979489-979637:+': {'TCGA-2K-A9WE-01A': '57.735244761448',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:979714-979819:+': {'TCGA-2K-A9WE-01A': '55.4926534096639',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:980541-980657:+': {'TCGA-2K-A9WE-01A': '54.1842062989528',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:980739-980903:+': {'TCGA-2K-A9WE-01A': '53.0446470077265',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:981113-981256:+': {'TCGA-2K-A9WE-01A': '67.2964135601965',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:981344-981468:+': {'TCGA-2K-A9WE-01A': '62.3231593167537',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:981540-981645:+': {'TCGA-2K-A9WE-01A': '62.2618644824245',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:981777-982115:+': {'TCGA-2K-A9WE-01A': '43.7746265787273',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:982200-982337:+': {'TCGA-2K-A9WE-01A': '55.5950702040439',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:982707-982834:+': {'TCGA-2K-A9WE-01A': '65.8521963855422',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:982953-983067:+': {'TCGA-2K-A9WE-01A': '75.4218835244995',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:983156-983275:+': {'TCGA-2K-A9WE-01A': '70.3080512703762',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:983392-983745:+': {'TCGA-2K-A9WE-01A': '52.7895078443819',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:984247-984439:+': {'TCGA-2K-A9WE-01A': '83.3033460115038',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:984616-984831:+': {'TCGA-2K-A9WE-01A': '93.6710589614669',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:984946-985175:+': {'TCGA-2K-A9WE-01A': '96.8485549803232',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:985283-985417:+': {'TCGA-2K-A9WE-01A': '95.145848821967',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:985613-985709:+': {'TCGA-2K-A9WE-01A': '122.502244837989',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:985807-985971:+': {'TCGA-2K-A9WE-01A': '98.7777345630366',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:986106-986217:+': {'TCGA-2K-A9WE-01A': '110.81262286339',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:986633-986749:+': {'TCGA-2K-A9WE-01A': '124.205836080808',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:986833-987025:+': {'TCGA-2K-A9WE-01A': '123.545521500141',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:987108-987195:+': {'TCGA-2K-A9WE-01A': '254.022929504906',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:989133-989357:+': {'TCGA-2K-A9WE-01A': '173.925910756325',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:989828-989931:+': {'TCGA-2K-A9WE-01A': '171.044173615351',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:990204-991492:+': {'TCGA-2K-A9WE-01A': '141.294087417746',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:995083-995162:+': {'TCGA-2K-A9WE-01A': '0.394250754787156',
  'TCGA-2Z-A9J1-01A': '0.7088608'},
 'chr1:995117-995226:+': {'TCGA-2K-A9WE-01A': '0.43009173249508',
  'TCGA-2Z-A9J1-01A': '0.9449542'},
 'chr1:995657-995773:+': {'TCGA-2K-A9WE-01A': '1.07829266266573',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:995660-995773:+': {'TCGA-2K-A9WE-01A': '1.10666878536746',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:995919-996088:+': {'TCGA-2K-A9WE-01A': '0.324677092177658',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:996400-996497:+': {'TCGA-2K-A9WE-01A': '0.402296688558323',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:997229-997436:+': {'TCGA-2K-A9WE-01A': '0.18954363210921',
  'TCGA-2Z-A9J1-01A': '0.6231884'},
 'chr1:998459-998581:+': {'TCGA-2K-A9WE-01A': '0.512846510292236',
  'TCGA-2Z-A9J1-01A': '0.9754099'},
 'chr1:1001210-1001833:+': {'TCGA-2K-A9WE-01A': '2.09761619534192',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1017198-1018367:-': {'TCGA-2K-A9WE-01A': '4.25251668838796',
  'TCGA-2Z-A9J1-01A': '0.9982891'},
 'chr1:1019295-1019763:-': {'TCGA-2K-A9WE-01A': '1.56355310000876',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1019861-1019886:-': {'TCGA-2K-A9WE-01A': '6.97520566161892',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1021258-1021392:-': {'TCGA-2K-A9WE-01A': '4.26374890362406',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1022519-1022584:-': {'TCGA-2K-A9WE-01A': '6.33190606173312',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1022878-1022977:-': {'TCGA-2K-A9WE-01A': '3.94250754787156',
  'TCGA-2Z-A9J1-01A': '0.9696970'},
 'chr1:1025733-1025808:-': {'TCGA-2K-A9WE-01A': '3.00875576021777',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1026256-1026363:-': {'TCGA-2K-A9WE-01A': '0.730093990346586',
  'TCGA-2Z-A9J1-01A': '0.4485981'},
 'chr1:1026658-1026754:-': {'TCGA-2K-A9WE-01A': '0.812888154200322',
  'TCGA-2Z-A9J1-01A': '0.7187500'},
 'chr1:1026852-1027554:-': {'TCGA-2K-A9WE-01A': '0.572028122166287',
  'TCGA-2Z-A9J1-01A': '0.4088319'},
 'chr1:1041336-1041507:-': {'TCGA-2K-A9WE-01A': '0.0458431110217624',
  'TCGA-2Z-A9J1-01A': '0.2807018'},
 'chr1:1050402-1050455:-': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1051440-1051736:-': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.1621622'},
 'chr1:1072397-1072490:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1076205-1076412:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0096618'},
 'chr1:1078119-1079432:+': {'TCGA-2K-A9WE-01A': '0.0180023175701898',
  'TCGA-2Z-A9J1-01A': '0.1827875'},
 'chr1:1102484-1102578:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.5106383'},
 'chr1:1103243-1103332:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1104385-1104467:+': {'TCGA-2K-A9WE-01A': '0.190000363752846',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1109286-1109306:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1109646-1109701:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1109804-1109869:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1108436-1111776:-': {'TCGA-2K-A9WE-01A': '0.00944030541244313',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1114569-1114713:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1114745-1114935:-': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1115037-1115233:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1115414-1115720:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1115863-1115981:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1116111-1116240:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1117121-1117195:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1117741-1117826:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1118256-1118427:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1119300-1119471:+': {'TCGA-2K-A9WE-01A': '0.183372444087049',
  'TCGA-2Z-A9J1-01A': '0.3274854'},
 'chr1:1120349-1121241:+': {'TCGA-2K-A9WE-01A': '0.0176596082771403',
  'TCGA-2Z-A9J1-01A': '0.1076233'},
 'chr1:1229203-1229313:-': {'TCGA-2K-A9WE-01A': '13.5679088584409',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1229470-1229579:-': {'TCGA-2K-A9WE-01A': '13.1894797965158',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1229782-1230008:-': {'TCGA-2K-A9WE-01A': nan, 'TCGA-2Z-A9J1-01A': nan}})
```
<p><code>clin_kipan.head().to_dict()</code></p>
```pd.DataFrame({'admin.disease_code': {'TCGA-2K-A9WE-01': 'kirp',
  'TCGA-2Z-A9J1-01': 'kirp',
  'TCGA-2Z-A9J2-01': 'kirp',
  'TCGA-2Z-A9J3-01': 'kirp',
  'TCGA-2Z-A9J5-01': 'kirp'},
 'days_to_death': {'TCGA-2K-A9WE-01': nan,
  'TCGA-2Z-A9J1-01': nan,
  'TCGA-2Z-A9J2-01': nan,
  'TCGA-2Z-A9J3-01': 1771.0,
  'TCGA-2Z-A9J5-01': nan},
 'vital_status': {'TCGA-2K-A9WE-01': 'alive',
  'TCGA-2Z-A9J1-01': 'alive',
  'TCGA-2Z-A9J2-01': 'alive',
  'TCGA-2Z-A9J3-01': 'dead',
  'TCGA-2Z-A9J5-01': 'alive'},
 'age_at_initial_pathologic_diagnosis': {'TCGA-2K-A9WE-01': 53.0,
  'TCGA-2Z-A9J1-01': 71.0,
  'TCGA-2Z-A9J2-01': 71.0,
  'TCGA-2Z-A9J3-01': 67.0,
  'TCGA-2Z-A9J5-01': 80.0},
 'gender': {'TCGA-2K-A9WE-01': 'male',
  'TCGA-2Z-A9J1-01': 'male',
  'TCGA-2Z-A9J2-01': 'female',
  'TCGA-2Z-A9J3-01': 'male',
  'TCGA-2Z-A9J5-01': 'male'},
 'karnofsky_performance_score': {'TCGA-2K-A9WE-01': nan,
  'TCGA-2Z-A9J1-01': nan,
  'TCGA-2Z-A9J2-01': nan,
  'TCGA-2Z-A9J3-01': nan,
  'TCGA-2Z-A9J5-01': nan},
 'patient.gender': {'TCGA-2K-A9WE-01': 0,
  'TCGA-2Z-A9J1-01': 0,
  'TCGA-2Z-A9J2-01': 1,
  'TCGA-2Z-A9J3-01': 0,
  'TCGA-2Z-A9J5-01': 0},
 'patient.vital_status': {'TCGA-2K-A9WE-01': 0,
  'TCGA-2Z-A9J1-01': 0,
  'TCGA-2Z-A9J2-01': 0,
  'TCGA-2Z-A9J3-01': 1,
  'TCGA-2Z-A9J5-01': 0},
 'survival': {'TCGA-2K-A9WE-01': 'lts',
  'TCGA-2Z-A9J1-01': 'lts',
  'TCGA-2Z-A9J2-01': 'lts',
  'TCGA-2Z-A9J3-01': 'lts',
  'TCGA-2Z-A9J5-01': 'lts'}})
```

Body:
I want to create a new dataframe df_rest based on two other dataframes exon_rna and clin_kipan by retaining the rows of exon_rna with indices unique from clin_kipan.

df_rest = pd.DataFrame(index=list( set( exon_rna.index.tolist()) - set( clin_kipan.index.tolist()) ), columns=clin_kipan.columns)

Traceback:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [5], in <cell line: 1>()
----> 1 df_rest = pd.DataFrame(index=list( set( exon_rna.index.tolist()) - set( clin_kipan.index.tolist()) ), columns=clin_kipan.columns)
      2 df_rest

File /usr/lib/python3/dist-packages/pandas/core/frame.py:411, in DataFrame.__init__(self, data, index, columns, dtype, copy)
    407     mgr = self._init_mgr(
    408         data, axes=dict(index=index, columns=columns), dtype=dtype, copy=copy
    409     )
    410 elif isinstance(data, dict):
--> 411     mgr = init_dict(data, index, columns, dtype=dtype)
    412 elif isinstance(data, ma.MaskedArray):
    413     import numpy.ma.mrecords as mrecords

File /usr/lib/python3/dist-packages/pandas/core/internals/construction.py:242, in init_dict(data, index, columns, dtype)
    240         else:
    241             nan_dtype = dtype
--> 242         val = construct_1d_arraylike_from_scalar(np.nan, len(index), nan_dtype)
    243         arrays.loc[missing] = [val] * missing.sum()
    245 else:

File /usr/lib/python3/dist-packages/pandas/core/dtypes/cast.py:1229, in construct_1d_arraylike_from_scalar(value, length, dtype)
   1227 else:
   1228     if not isinstance(dtype, (np.dtype, type(np.dtype))):
-> 1229         dtype = dtype.dtype
   1231     if length and is_integer_dtype(dtype) and isna(value):
   1232         # coerce if we have nan for an integer dtype
   1233         dtype = np.dtype("float64")

AttributeError: type object 'object' has no attribute 'dtype'

Data:

exon_rna.head()

pd.DataFrame({'chr1:11874-12227:+': {'TCGA-2K-A9WE-01A': '0.15591837759944',
  'TCGA-2Z-A9J1-01A': '0.2719547'},
 'chr1:12595-12721:+': {'TCGA-2K-A9WE-01A': '0.24834693214939',
  'TCGA-2Z-A9J1-01A': '0.7301587'},
 'chr1:12613-12721:+': {'TCGA-2K-A9WE-01A': '0.289358352137362',
  'TCGA-2Z-A9J1-01A': '0.8518519'},
 'chr1:12646-12697:+': {'TCGA-2K-A9WE-01A': '0.454904717062103',
  'TCGA-2Z-A9J1-01A': '0.8823529'},
 'chr1:13221-14409:+': {'TCGA-2K-A9WE-01A': '0.954955570888991',
  'TCGA-2Z-A9J1-01A': '0.6026936'},
 'chr1:13403-14409:+': {'TCGA-2K-A9WE-01A': '1.02575668077691',
  'TCGA-2Z-A9J1-01A': '0.6272366'},
 'chr1:14363-16765:-': {'TCGA-2K-A9WE-01A': '13.7323296611257',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:16854-17055:-': {'TCGA-2K-A9WE-01A': '33.8431093465806',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:17233-18061:-': {'TCGA-2K-A9WE-01A': '24.0355043992073',
  'TCGA-2Z-A9J1-01A': '0.9106280'},
 'chr1:18268-18379:-': {'TCGA-2K-A9WE-01A': '39.6362812402087',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:18497-18554:-': {'TCGA-2K-A9WE-01A': '16.5857214082873',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:18913-19759:-': {'TCGA-2K-A9WE-01A': '12.3069539038635',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:24738-24901:-': {'TCGA-2K-A9WE-01A': '11.683284562595',
  'TCGA-2Z-A9J1-01A': '0.9570552'},
 'chr1:29321-29370:-': {'TCGA-2K-A9WE-01A': '1.57700301914863',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:29824-29961:-': {'TCGA-2K-A9WE-01A': '0.628515696037495',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:34612-35174:-': {'TCGA-2K-A9WE-01A': '0.0280107108196914',
  'TCGA-2Z-A9J1-01A': '0.1708185'},
 'chr1:35277-35481:-': {'TCGA-2K-A9WE-01A': '0.115390464815753',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:35721-36081:-': {'TCGA-2K-A9WE-01A': '0.0218421470796208',
  'TCGA-2Z-A9J1-01A': '0.1333333'},
 'chr1:69091-70008:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:89295-90404:-': {'TCGA-2K-A9WE-01A': '1.05133534609908',
  'TCGA-2Z-A9J1-01A': '0.7772768'},
 'chr1:137839-139228:-': {'TCGA-2K-A9WE-01A': '9.20107516927723',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:236615-237877:-': {'TCGA-2K-A9WE-01A': '1.38596464865794',
  'TCGA-2Z-A9J1-01A': '0.9928685'},
 'chr1:321084-321114:+': {'TCGA-2K-A9WE-01A': '21.3658473562072',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:321146-321223:+': {'TCGA-2K-A9WE-01A': '11.3220729579901',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:322037-322228:+': {'TCGA-2K-A9WE-01A': '2.87474508698968',
  'TCGA-2Z-A9J1-01A': '0.9790576'},
 'chr1:323892-324060:+': {'TCGA-2K-A9WE-01A': '2.84607053751675',
  'TCGA-2Z-A9J1-01A': '0.9702381'},
 'chr1:324288-324345:+': {'TCGA-2K-A9WE-01A': '0.407845608400506',
  'TCGA-2Z-A9J1-01A': '0.6842105'},
 'chr1:324439-328580:+': {'TCGA-2K-A9WE-01A': '9.23471951459437',
  'TCGA-2Z-A9J1-01A': '0.9801980'},
 'chr1:367659-368595:+': {'TCGA-2K-A9WE-01A': '0.0252455125797539',
  'TCGA-2Z-A9J1-01A': '0.1463675'},
 'chr1:420206-420296:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:420992-421258:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:421396-421839:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0767494'},
 'chr1:566462-568045:+': {'TCGA-2K-A9WE-01A': '5202.77588235356',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:568149-568842:+': {'TCGA-2K-A9WE-01A': '869.021829435309',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:568844-568912:+': {'TCGA-2K-A9WE-01A': '30.6258557341907',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:569327-570349:+': {'TCGA-2K-A9WE-01A': '3388.6912187813',
  'TCGA-2Z-A9J1-01A': '0.9608610'},
 'chr1:621098-622034:-': {'TCGA-2K-A9WE-01A': '0.0252455125797539',
  'TCGA-2Z-A9J1-01A': '0.1452992'},
 'chr1:661140-665184:-': {'TCGA-2K-A9WE-01A': '9.40353839848327',
  'TCGA-2Z-A9J1-01A': '0.9985163'},
 'chr1:665278-665335:-': {'TCGA-2K-A9WE-01A': '4.75819876467258',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:665563-665731:-': {'TCGA-2K-A9WE-01A': '2.8927274315744',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:667397-667587:-': {'TCGA-2K-A9WE-01A': '4.29341136103291',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:668402-668479:-': {'TCGA-2K-A9WE-01A': '12.9395119519887',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:668511-668541:-': {'TCGA-2K-A9WE-01A': '24.6724665899059',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:668687-668744:-': {'TCGA-2K-A9WE-01A': '8.83665484867764',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:670803-670994:-': {'TCGA-2K-A9WE-01A': '5.05133779571044',
  'TCGA-2Z-A9J1-01A': '0.9947644'},
 'chr1:671808-671885:-': {'TCGA-2K-A9WE-01A': '8.18828490711786',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:671917-671947:-': {'TCGA-2K-A9WE-01A': '13.4808322604641',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:674240-674404:-': {'TCGA-2K-A9WE-01A': '6.40358801714896',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:675183-675415:-': {'TCGA-2K-A9WE-01A': '7.4789198976791',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:675509-675566:-': {'TCGA-2K-A9WE-01A': '3.94250754787156',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:678666-678730:-': {'TCGA-2K-A9WE-01A': '3.88185358559662',
  'TCGA-2Z-A9J1-01A': '0.9375000'},
 'chr1:679575-679736:-': {'TCGA-2K-A9WE-01A': '1.99559024028067',
  'TCGA-2Z-A9J1-01A': '0.8322982'},
 'chr1:700237-700627:-': {'TCGA-2K-A9WE-01A': '0.867149997741571',
  'TCGA-2Z-A9J1-01A': '0.9025641'},
 'chr1:701709-701767:-': {'TCGA-2K-A9WE-01A': '1.60373188387996',
  'TCGA-2Z-A9J1-01A': '0.9655172'},
 'chr1:703928-703993:-': {'TCGA-2K-A9WE-01A': '5.61508650757465',
  'TCGA-2Z-A9J1-01A': '0.9076923'},
 'chr1:704877-705092:-': {'TCGA-2K-A9WE-01A': '2.3728054686264',
  'TCGA-2Z-A9J1-01A': '0.8465116'},
 'chr1:708356-708487:-': {'TCGA-2K-A9WE-01A': '1.79204888539616',
  'TCGA-2Z-A9J1-01A': '0.7557252'},
 'chr1:709551-709660:-': {'TCGA-2K-A9WE-01A': '4.1575534141191',
  'TCGA-2Z-A9J1-01A': '0.7706422'},
 'chr1:713664-714006:-': {'TCGA-2K-A9WE-01A': '0.873558523726644',
  'TCGA-2Z-A9J1-01A': '0.7339181'},
 'chr1:761587-762902:-': {'TCGA-2K-A9WE-01A': '1.17436395042983',
  'TCGA-2Z-A9J1-01A': '0.9749050'},
 'chr1:763064-763155:+': {'TCGA-2K-A9WE-01A': '1.45701365899601',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:764383-764484:+': {'TCGA-2K-A9WE-01A': '2.24181801741716',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:783034-783186:+': {'TCGA-2K-A9WE-01A': '1.59761743769959',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:787307-787490:+': {'TCGA-2K-A9WE-01A': '3.08544068963861',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:788051-788146:+': {'TCGA-2K-A9WE-01A': '4.5174565652695',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:788771-789740:+': {'TCGA-2K-A9WE-01A': '4.65784912356785',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:791898-794579:+': {'TCGA-2K-A9WE-01A': '0.711474143612914',
  'TCGA-2Z-A9J1-01A': '0.9492726'},
 'chr1:803453-804055:-': {'TCGA-2K-A9WE-01A': '1.22917316583724',
  'TCGA-2Z-A9J1-01A': '0.9269103'},
 'chr1:809492-810535:-': {'TCGA-2K-A9WE-01A': '0.0302107858074449',
  'TCGA-2Z-A9J1-01A': '0.1639501'},
 'chr1:812126-812182:-': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.8214286'},
 'chr1:846815-846853:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:847325-850328:+': {'TCGA-2K-A9WE-01A': '0.0262483858047374',
  'TCGA-2Z-A9J1-01A': '0.0799201'},
 'chr1:852953-853100:-': {'TCGA-2K-A9WE-01A': '1.2253739675817',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:853402-853555:-': {'TCGA-2K-A9WE-01A': '0.921625141060885',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:854205-854295:-': {'TCGA-2K-A9WE-01A': '1.03978221042766',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:854715-854817:-': {'TCGA-2K-A9WE-01A': '0.382767723094326',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:860530-860569:+': {'TCGA-2K-A9WE-01A': '0.394250754787156',
  'TCGA-2Z-A9J1-01A': '0.7948718'},
 'chr1:861121-861180:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.1864407'},
 'chr1:861302-861393:+': {'TCGA-2K-A9WE-01A': '0.599946800763064',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:865535-865716:+': {'TCGA-2K-A9WE-01A': '1.51634905687368',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:866419-866469:+': {'TCGA-2K-A9WE-01A': '2.00990580871884',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:871152-871276:+': {'TCGA-2K-A9WE-01A': '1.82932350221241',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:874420-874509:+': {'TCGA-2K-A9WE-01A': '2.7159496440893',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:874655-874840:+': {'TCGA-2K-A9WE-01A': '1.22938407406748',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:876524-876686:+': {'TCGA-2K-A9WE-01A': '1.35448112074115',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:877516-877631:+': {'TCGA-2K-A9WE-01A': '3.12681633107055',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:877790-877868:+': {'TCGA-2K-A9WE-01A': '2.39544762402323',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:877939-878438:+': {'TCGA-2K-A9WE-01A': '1.90817365316984',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:878633-878757:+': {'TCGA-2K-A9WE-01A': '5.61413074816911',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:879078-879188:+': {'TCGA-2K-A9WE-01A': '5.18564055846169',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:879288-879961:+': {'TCGA-2K-A9WE-01A': '16.7527323695907',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:879584-880180:-': {'TCGA-2K-A9WE-01A': '27.6569876222548',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:880422-880526:-': {'TCGA-2K-A9WE-01A': '47.4602813381872',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:880898-881033:-': {'TCGA-2K-A9WE-01A': '41.6862195135243',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:881553-881666:-': {'TCGA-2K-A9WE-01A': '36.2434027207842',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:881782-881925:-': {'TCGA-2K-A9WE-01A': '27.378524637997',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:883511-883612:-': {'TCGA-2K-A9WE-01A': '27.7521609742332',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:883870-883983:-': {'TCGA-2K-A9WE-01A': '30.9867259902888',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:886507-886618:-': {'TCGA-2K-A9WE-01A': '27.104739391617',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:887380-887519:-': {'TCGA-2K-A9WE-01A': '20.6136823217285',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:887792-887980:-': {'TCGA-2K-A9WE-01A': '17.3136574853619',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:888555-888668:-': {'TCGA-2K-A9WE-01A': '17.222532972281',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:889162-889272:-': {'TCGA-2K-A9WE-01A': '16.5514280838572',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:889384-889903:-': {'TCGA-2K-A9WE-01A': '3.88185358559662',
  'TCGA-2Z-A9J1-01A': '0.9672447'},
 'chr1:891303-891393:-': {'TCGA-2K-A9WE-01A': '16.549866849307',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:891475-891595:-': {'TCGA-2K-A9WE-01A': '19.2237971342498',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:892274-892405:-': {'TCGA-2K-A9WE-01A': '16.1284399685655',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:892479-894461:-': {'TCGA-2K-A9WE-01A': '2.43349936389047',
  'TCGA-2Z-A9J1-01A': '0.7462159'},
 'chr1:894595-894679:-': {'TCGA-2K-A9WE-01A': '8.16330974618112',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:895967-896180:+': {'TCGA-2K-A9WE-01A': '0.294766919467033',
  'TCGA-2Z-A9J1-01A': '0.6291080'},
 'chr1:896673-897130:+': {'TCGA-2K-A9WE-01A': '1.54945711488402',
  'TCGA-2Z-A9J1-01A': '0.9431072'},
 'chr1:897206-897858:+': {'TCGA-2K-A9WE-01A': '2.25803648224191',
  'TCGA-2Z-A9J1-01A': '0.9662577'},
 'chr1:898084-898297:+': {'TCGA-2K-A9WE-01A': '3.09505265440384',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:898412-899229:+': {'TCGA-2K-A9WE-01A': '1.9471553170417',
  'TCGA-2Z-A9J1-01A': '0.8470012'},
 'chr1:899300-899388:+': {'TCGA-2K-A9WE-01A': '6.29029294154789',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:899487-899560:+': {'TCGA-2K-A9WE-01A': '5.96703845083264',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:899729-899910:+': {'TCGA-2K-A9WE-01A': '4.15912884171066',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:900343-901095:+': {'TCGA-2K-A9WE-01A': '3.86397154094185',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:901877-901994:+': {'TCGA-2K-A9WE-01A': '1.47008756022329',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:902084-902183:+': {'TCGA-2K-A9WE-01A': '2.28665437776551',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:905657-905803:+': {'TCGA-2K-A9WE-01A': '1.5019076372844',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:905901-905981:+': {'TCGA-2K-A9WE-01A': '1.36284211531363',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:906066-906386:+': {'TCGA-2K-A9WE-01A': '1.08081203804579',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:906457-906588:+': {'TCGA-2K-A9WE-01A': '2.1504586624754',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:906704-906784:+': {'TCGA-2K-A9WE-01A': '2.33630076910907',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:907455-907530:+': {'TCGA-2K-A9WE-01A': '2.28250436982038',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:907668-907804:+': {'TCGA-2K-A9WE-01A': '2.58996846210541',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:908241-908390:+': {'TCGA-2K-A9WE-01A': '2.36550452872294',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:908566-908706:+': {'TCGA-2K-A9WE-01A': '2.23688371510443',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:908880-909020:+': {'TCGA-2K-A9WE-01A': '1.90135115783877',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:909213-909431:+': {'TCGA-2K-A9WE-01A': '2.37630591926505',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:909696-909744:+': {'TCGA-2K-A9WE-01A': '3.54021085931324',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:909822-910482:+': {'TCGA-2K-A9WE-01A': '1.57461723545854',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:910579-911649:-': {'TCGA-2K-A9WE-01A': '1.44300929856737',
  'TCGA-2Z-A9J1-01A': '0.9607477'},
 'chr1:911879-912021:-': {'TCGA-2K-A9WE-01A': '0.165419897113492',
  'TCGA-2Z-A9J1-01A': '0.8380282'},
 'chr1:914261-916037:-': {'TCGA-2K-A9WE-01A': '0.0665589344041344',
  'TCGA-2Z-A9J1-01A': '0.7162162'},
 'chr1:916517-916553:-': {'TCGA-2K-A9WE-01A': '0.213108516101166',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:917445-917473:-': {'TCGA-2K-A9WE-01A': '0.271897072267004',
  'TCGA-2Z-A9J1-01A': '0.7500000'},
 'chr1:934342-934812:-': {'TCGA-2K-A9WE-01A': '2.31025920002665',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:934906-934993:-': {'TCGA-2K-A9WE-01A': '13.3507641962014',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:935072-935552:-': {'TCGA-2K-A9WE-01A': '3.08187700207839',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:948847-948956:+': {'TCGA-2K-A9WE-01A': '29.3179197650813',
  'TCGA-2Z-A9J1-01A': '0.9449542'},
 'chr1:949364-949915:+': {'TCGA-2K-A9WE-01A': '35.9682391505094',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:955503-955753:+': {'TCGA-2K-A9WE-01A': '7.69652867911182',
  'TCGA-2Z-A9J1-01A': '0.7760000'},
 'chr1:957581-957842:+': {'TCGA-2K-A9WE-01A': '36.2650503449254',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:970657-970704:+': {'TCGA-2K-A9WE-01A': '39.2608043308876',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:976045-976260:+': {'TCGA-2K-A9WE-01A': '17.3762369702487',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:976553-976777:+': {'TCGA-2K-A9WE-01A': '10.5834424840641',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:976858-977082:+': {'TCGA-2K-A9WE-01A': '30.6989921060932',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:977336-977542:+': {'TCGA-2K-A9WE-01A': '40.9868417537179',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:978619-978837:+': {'TCGA-2K-A9WE-01A': '42.017409208823',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:978918-979112:+': {'TCGA-2K-A9WE-01A': '44.0752125864616',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:979203-979403:+': {'TCGA-2K-A9WE-01A': '46.3685962346685',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:979489-979637:+': {'TCGA-2K-A9WE-01A': '57.735244761448',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:979714-979819:+': {'TCGA-2K-A9WE-01A': '55.4926534096639',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:980541-980657:+': {'TCGA-2K-A9WE-01A': '54.1842062989528',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:980739-980903:+': {'TCGA-2K-A9WE-01A': '53.0446470077265',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:981113-981256:+': {'TCGA-2K-A9WE-01A': '67.2964135601965',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:981344-981468:+': {'TCGA-2K-A9WE-01A': '62.3231593167537',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:981540-981645:+': {'TCGA-2K-A9WE-01A': '62.2618644824245',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:981777-982115:+': {'TCGA-2K-A9WE-01A': '43.7746265787273',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:982200-982337:+': {'TCGA-2K-A9WE-01A': '55.5950702040439',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:982707-982834:+': {'TCGA-2K-A9WE-01A': '65.8521963855422',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:982953-983067:+': {'TCGA-2K-A9WE-01A': '75.4218835244995',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:983156-983275:+': {'TCGA-2K-A9WE-01A': '70.3080512703762',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:983392-983745:+': {'TCGA-2K-A9WE-01A': '52.7895078443819',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:984247-984439:+': {'TCGA-2K-A9WE-01A': '83.3033460115038',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:984616-984831:+': {'TCGA-2K-A9WE-01A': '93.6710589614669',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:984946-985175:+': {'TCGA-2K-A9WE-01A': '96.8485549803232',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:985283-985417:+': {'TCGA-2K-A9WE-01A': '95.145848821967',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:985613-985709:+': {'TCGA-2K-A9WE-01A': '122.502244837989',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:985807-985971:+': {'TCGA-2K-A9WE-01A': '98.7777345630366',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:986106-986217:+': {'TCGA-2K-A9WE-01A': '110.81262286339',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:986633-986749:+': {'TCGA-2K-A9WE-01A': '124.205836080808',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:986833-987025:+': {'TCGA-2K-A9WE-01A': '123.545521500141',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:987108-987195:+': {'TCGA-2K-A9WE-01A': '254.022929504906',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:989133-989357:+': {'TCGA-2K-A9WE-01A': '173.925910756325',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:989828-989931:+': {'TCGA-2K-A9WE-01A': '171.044173615351',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:990204-991492:+': {'TCGA-2K-A9WE-01A': '141.294087417746',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:995083-995162:+': {'TCGA-2K-A9WE-01A': '0.394250754787156',
  'TCGA-2Z-A9J1-01A': '0.7088608'},
 'chr1:995117-995226:+': {'TCGA-2K-A9WE-01A': '0.43009173249508',
  'TCGA-2Z-A9J1-01A': '0.9449542'},
 'chr1:995657-995773:+': {'TCGA-2K-A9WE-01A': '1.07829266266573',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:995660-995773:+': {'TCGA-2K-A9WE-01A': '1.10666878536746',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:995919-996088:+': {'TCGA-2K-A9WE-01A': '0.324677092177658',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:996400-996497:+': {'TCGA-2K-A9WE-01A': '0.402296688558323',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:997229-997436:+': {'TCGA-2K-A9WE-01A': '0.18954363210921',
  'TCGA-2Z-A9J1-01A': '0.6231884'},
 'chr1:998459-998581:+': {'TCGA-2K-A9WE-01A': '0.512846510292236',
  'TCGA-2Z-A9J1-01A': '0.9754099'},
 'chr1:1001210-1001833:+': {'TCGA-2K-A9WE-01A': '2.09761619534192',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1017198-1018367:-': {'TCGA-2K-A9WE-01A': '4.25251668838796',
  'TCGA-2Z-A9J1-01A': '0.9982891'},
 'chr1:1019295-1019763:-': {'TCGA-2K-A9WE-01A': '1.56355310000876',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1019861-1019886:-': {'TCGA-2K-A9WE-01A': '6.97520566161892',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1021258-1021392:-': {'TCGA-2K-A9WE-01A': '4.26374890362406',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1022519-1022584:-': {'TCGA-2K-A9WE-01A': '6.33190606173312',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1022878-1022977:-': {'TCGA-2K-A9WE-01A': '3.94250754787156',
  'TCGA-2Z-A9J1-01A': '0.9696970'},
 'chr1:1025733-1025808:-': {'TCGA-2K-A9WE-01A': '3.00875576021777',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1026256-1026363:-': {'TCGA-2K-A9WE-01A': '0.730093990346586',
  'TCGA-2Z-A9J1-01A': '0.4485981'},
 'chr1:1026658-1026754:-': {'TCGA-2K-A9WE-01A': '0.812888154200322',
  'TCGA-2Z-A9J1-01A': '0.7187500'},
 'chr1:1026852-1027554:-': {'TCGA-2K-A9WE-01A': '0.572028122166287',
  'TCGA-2Z-A9J1-01A': '0.4088319'},
 'chr1:1041336-1041507:-': {'TCGA-2K-A9WE-01A': '0.0458431110217624',
  'TCGA-2Z-A9J1-01A': '0.2807018'},
 'chr1:1050402-1050455:-': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1051440-1051736:-': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.1621622'},
 'chr1:1072397-1072490:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1076205-1076412:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0096618'},
 'chr1:1078119-1079432:+': {'TCGA-2K-A9WE-01A': '0.0180023175701898',
  'TCGA-2Z-A9J1-01A': '0.1827875'},
 'chr1:1102484-1102578:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.5106383'},
 'chr1:1103243-1103332:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1104385-1104467:+': {'TCGA-2K-A9WE-01A': '0.190000363752846',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1109286-1109306:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1109646-1109701:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1109804-1109869:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1108436-1111776:-': {'TCGA-2K-A9WE-01A': '0.00944030541244313',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1114569-1114713:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1114745-1114935:-': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1115037-1115233:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1115414-1115720:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1115863-1115981:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1116111-1116240:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1117121-1117195:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1117741-1117826:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1118256-1118427:+': {'TCGA-2K-A9WE-01A': '0',
  'TCGA-2Z-A9J1-01A': '0.0000000'},
 'chr1:1119300-1119471:+': {'TCGA-2K-A9WE-01A': '0.183372444087049',
  'TCGA-2Z-A9J1-01A': '0.3274854'},
 'chr1:1120349-1121241:+': {'TCGA-2K-A9WE-01A': '0.0176596082771403',
  'TCGA-2Z-A9J1-01A': '0.1076233'},
 'chr1:1229203-1229313:-': {'TCGA-2K-A9WE-01A': '13.5679088584409',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1229470-1229579:-': {'TCGA-2K-A9WE-01A': '13.1894797965158',
  'TCGA-2Z-A9J1-01A': '1.0000000'},
 'chr1:1229782-1230008:-': {'TCGA-2K-A9WE-01A': nan, 'TCGA-2Z-A9J1-01A': nan}})

clin_kipan.head().to_dict()

pd.DataFrame({'admin.disease_code': {'TCGA-2K-A9WE-01': 'kirp',
  'TCGA-2Z-A9J1-01': 'kirp',
  'TCGA-2Z-A9J2-01': 'kirp',
  'TCGA-2Z-A9J3-01': 'kirp',
  'TCGA-2Z-A9J5-01': 'kirp'},
 'days_to_death': {'TCGA-2K-A9WE-01': nan,
  'TCGA-2Z-A9J1-01': nan,
  'TCGA-2Z-A9J2-01': nan,
  'TCGA-2Z-A9J3-01': 1771.0,
  'TCGA-2Z-A9J5-01': nan},
 'vital_status': {'TCGA-2K-A9WE-01': 'alive',
  'TCGA-2Z-A9J1-01': 'alive',
  'TCGA-2Z-A9J2-01': 'alive',
  'TCGA-2Z-A9J3-01': 'dead',
  'TCGA-2Z-A9J5-01': 'alive'},
 'age_at_initial_pathologic_diagnosis': {'TCGA-2K-A9WE-01': 53.0,
  'TCGA-2Z-A9J1-01': 71.0,
  'TCGA-2Z-A9J2-01': 71.0,
  'TCGA-2Z-A9J3-01': 67.0,
  'TCGA-2Z-A9J5-01': 80.0},
 'gender': {'TCGA-2K-A9WE-01': 'male',
  'TCGA-2Z-A9J1-01': 'male',
  'TCGA-2Z-A9J2-01': 'female',
  'TCGA-2Z-A9J3-01': 'male',
  'TCGA-2Z-A9J5-01': 'male'},
 'karnofsky_performance_score': {'TCGA-2K-A9WE-01': nan,
  'TCGA-2Z-A9J1-01': nan,
  'TCGA-2Z-A9J2-01': nan,
  'TCGA-2Z-A9J3-01': nan,
  'TCGA-2Z-A9J5-01': nan},
 'patient.gender': {'TCGA-2K-A9WE-01': 0,
  'TCGA-2Z-A9J1-01': 0,
  'TCGA-2Z-A9J2-01': 1,
  'TCGA-2Z-A9J3-01': 0,
  'TCGA-2Z-A9J5-01': 0},
 'patient.vital_status': {'TCGA-2K-A9WE-01': 0,
  'TCGA-2Z-A9J1-01': 0,
  'TCGA-2Z-A9J2-01': 0,
  'TCGA-2Z-A9J3-01': 1,
  'TCGA-2Z-A9J5-01': 0},
 'survival': {'TCGA-2K-A9WE-01': 'lts',
  'TCGA-2Z-A9J1-01': 'lts',
  'TCGA-2Z-A9J2-01': 'lts',
  'TCGA-2Z-A9J3-01': 'lts',
  'TCGA-2Z-A9J5-01': 'lts'}})


来源: stackexchange

问:
Facebook connect to external app inside iframed fan page content
I have an app that implements facebook connect to login/register.

I've also set up a fan page for that app. Suppose I render my connect button inside the iframe showing on the fan page. Will that work?

The objective is to allow people to register for my application while viewing the fan page for it.

ContentLicense: CC BY-SA 3.0


问:
http challenge response POST with curl
I have written a small c++ program to connect to my router (avm Fritzbox 7590) using a challenge response method.

For this I use openssl (SHA256), curl(GET & POST) and tinyXML (parsing the response).

I have a member function "query_challenge()" to query the FritzBox for a challenge.

This I receive as .xml, this I receive:

```<code><?xml version="1.0" encoding="utf-8"?>
<SessionInfo>
    <SID>0000000000000000</SID>
    <Challenge>2$60000$*******************$6000$15a84421a7dfc4d9ac8026f776de48f3</Challenge>
    <BlockTime>0</BlockTime>
    <Rights/>
    <Users>
        <User last="1">adminxxx</User>
    </Users>
</SessionInfo>
</code>```

With the member function "std::string calculate_pbkdf2_response()" I evaluate the received challenge and send this "query_sessionID()" with a POST to the FritzBox to log in and get a valid SessionID.

When calling my query_sessionID() method, if everything is correct, I should get another XML via the POST in which a valid SID(SessionID) is contained.

However, I get the following response:

```<code><?xml version="1.0" encoding="utf-8"?>
<SessionInfo>
    <SID>0000000000000000</SID>
    <Challenge>2$60000$diffent*******************$6000$1268d1df004ffdb2fd8074b557467a01</Challenge>
    <BlockTime>128</BlockTime>
    <Rights/>
    <Users>
        <User last="1">adminxxx</User>
    </Users>
</SessionInfo>
</code>```

which shows that either the calculated resopnse is incorrect or the POST may not have worked correctly.

I tested my calculate_pbkdf2_response() with the example below.

The example challenge “2$10000$5A1711$2000$5A1722” and the password
“1example!“  (utf8-encoded) results in: hash1 =
pbdkf2_hmac_sha256(“1example!”, 5A1711, 10000)
=> 0x23428e9dec39d95ac7a40514062df0f9e94f996e17c398c79898d0403b332d3b (hex) response = 5A1722$ + pbdkf2_hmac_sha256(hash1, 5A1722,
2000).hex()
=> 5A1722$1798a1672bca7c6463d6b245f82b53703b0f50813401b03e4045a5861e689adb
https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AVM_Technical_Note_-_Session_ID_english_2021-05-03.pdf

This "5A1722$1798a1672bca7c6463d6b245f82b53703b0f50813401b03e4045a5861e689adb" response gets my calculate_pbkdf2_response() method also out with the respective PW and challenge.

So I suspect that my CURL POST request may not be correct.
Maybe someone has a tip who has more experience with this stuff, this is my first http attempt with CURL as well as the first use of openSSL or challenge response method.

main.cpp:

```<code>#include <iostream>
#include "../public/FritzBox_Session.hpp"

int main(int argc, char const *argv[])
{
  std::string user = "adminxxx";
  std::string pw = "passwort";
  homeAutomat::FritzBox::FritzBox_Session TEST(user, pw);
  TEST.establish_connection();

  return 0;
}
</code>```

FritzBox_Session.hpp:

```<code>    #include <iostream>
    #include <string>
    #include <sstream>

    #include <curl/curl.h>
    #include <nlohmann/json.hpp>
    #include <tinyxml2.h>
    #include <openssl/evp.h>
    #include <openssl/sha.h>

    namespace homeAutomat {

    namespace FritzBox {

    class FritzBox_Session
    {
    private:

      CURL *curl;
      const std::string fritzbox_addr = "http://fritz.box/login_sid.lua?version=2";

      std::string mUsername;
      std::string mPassword;

      std::stringstream mChallenge;
      std::string mSID;

      tinyxml2::XMLDocument XML_response;

      bool query_challenge();
      bool query_sessionID();

      std::string calculate_pbkdf2_response();

    public:
      FritzBox_Session(std::string &username, std::string &password);
      ~FritzBox_Session();

      bool establish_connection();
    };

    } // FritzBox
    } // homeAutomat
</code>```

FritzBox_Session.cpp:

```<code>    #include "FritzBox_Session.hpp"

using namespace homeAutomat;
using namespace FritzBox;

using namespace nlohmann;

namespace {

// CURL - ReadReceivedData Callback-Fuction
size_t writeFunction(void *ptr, size_t size, size_t nmemb, void *userdata)
{
  ((std::string*)userdata)->append((char*)ptr, size * nmemb);
  return size * nmemb;
}

}

FritzBox_Session::FritzBox_Session(std::string &username, std::string &password)
:
mUsername(username),
mPassword(password)
{
  curl = curl_easy_init();
  if(!curl){
    std::cerr << "curl isn't initialized! " << std::endl;
  }

}

FritzBox_Session::~FritzBox_Session()
{
  curl_easy_cleanup(curl);
}

bool FritzBox_Session::establish_connection()
{
  if(query_challenge()){
    if(query_sessionID()){

    }
    else{
      std::cerr << "error at query_sessionID() occurred" << std::endl;
      return false;
    }
  }
  else{
    std::cerr << "error at query_challenge() occurred" << std::endl;
      return false;
  }
  return true;
}

bool FritzBox_Session::query_challenge()
{
  std::string readBuffer;
  CURLcode retVal;

  if(!curl){
    std::cerr << "curl isn't initialized!'" << std::endl;
    return 1;
  }

  curl_easy_setopt(curl, CURLOPT_URL, fritzbox_addr.c_str());
  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeFunction);
  curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);

  retVal = curl_easy_perform(curl);
  if(retVal != CURLE_OK){
    std::cerr << "curl_easy_perform() failed: " << curl_easy_strerror(retVal) << std::endl;
    return false;
  }

  int error_id = XML_response.Parse(&readBuffer[0]);
  if(error_id != tinyxml2::XML_SUCCESS){
    std::cout << "xml parse error" << XML_response.ErrorName() << std::endl;
    XML_response.Clear();
    return false;
  }

  auto save_xml_to_file = XML_response.SaveFile("response_query_challenge.xml");
  if(save_xml_to_file != tinyxml2::XML_SUCCESS){
    std::cout << "xml save to file error: " << XML_response.ErrorName() << std::endl;
  }

  // search for  <SessionInfo>
  tinyxml2::XMLElement* sessionInfo = XML_response.FirstChildElement("SessionInfo");
  if(sessionInfo == nullptr){
    std::cerr << "XML response has no <SessionInfo>-Variable!" << std::endl;
    XML_response.Clear();
    return false;
  }
  // search for  <SessionInfo> <Challenge> </SessionInfo>
  tinyxml2::XMLElement* challenge = sessionInfo->FirstChildElement("Challenge");
  if(challenge == nullptr){
    std::cerr << "XML response has no <Challenge>-Variable!" << std::endl;
    XML_response.Clear();
    return false;
  }
  // get String Value of <SessionInfo> <Challenge> </SessionInfo>
  mChallenge << challenge->GetText();
  if(mChallenge.str().empty()){
    std::cerr << "XML response <Challenge> is empty!" << std::endl;
    XML_response.Clear();
    return false;
  }

  XML_response.Clear();
  return true;

}

bool FritzBox_Session::query_sessionID()
{
  CURLcode retVal;
  std::string readBuffer;
  std::string response = calculate_pbkdf2_response();

  if (!curl) {
    std::cerr << "Fehler beim Initialisieren von CURL" << std::endl;
    return 1;
  }

  // HTTP Method 'POST'
  curl_easy_setopt(curl, CURLOPT_POST, 1L);

  // Set POST Data
  std::string post_data = "username=" + mUsername + "&response=" + response;
  curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, post_data.length());
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, &post_data[0]);

  // Set Content-Type-Header
  struct curl_slist* headers = NULL;
  headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

  // Set Callback to writeFunction() received data
 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeFunction);
 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);

  // Send POST data and received answer
  retVal = curl_easy_perform(curl);
  if(retVal != CURLE_OK){
    std::cerr << "Error while sending the request: " << curl_easy_strerror(retVal) << std::endl;
    return false;
  }
  else{

    int error_id = XML_response.Parse(&readBuffer[0]);
    if(error_id != tinyxml2::XML_SUCCESS){
      std::cout << "xml parse error" << XML_response.ErrorName() << std::endl;
    }

    auto save_xml_to_file = XML_response.SaveFile("response_query_sessionID.xml");
    if(save_xml_to_file != tinyxml2::XML_SUCCESS){
      std::cout << "xml save to file error: " << XML_response.ErrorName() << std::endl;
    }

    tinyxml2::XMLElement* sessionInfo = XML_response.FirstChildElement("SessionInfo");
    if(sessionInfo == nullptr){
      std::cerr << "XML response has no <SessionInfo>-Variable!" << std::endl;
      XML_response.Clear();
      return false;
    }

    tinyxml2::XMLElement* SID = sessionInfo->FirstChildElement("SID");
    if(SID == nullptr){
      std::cerr << "XML response has no <SID>-Variable!" << std::endl;
      XML_response.Clear();
      return false;
    }

    mSID = SID->GetText();
    if(mSID.empty()){
      std::cerr << "XML response <SID> is empty!" << std::endl;
      XML_response.Clear();
      return false;
    }

    if(mSID.compare("0000000000000000") == 0){
      std::cerr << "username or password wrong!" << std::endl;
    }
    else{
      std::cout << "login was successful SID is: " << mSID << std::endl;
    }

    return true;
  }

}

std::string FritzBox_Session::calculate_pbkdf2_response()
{
  // Split the challenge into parts
  std::vector<std::string> challenge_parts;
  std::string item;
  while (std::getline(mChallenge, item, '$'))
  {
    challenge_parts.push_back(item);
  }

  // Extract all necessary values encoded into the challenge
  int iter1 = std::stoi(challenge_parts[1]);
  int iter2 = std::stoi(challenge_parts[3]);

  // Convert the salt strings to unsigned char arrays
  unsigned char salt1[challenge_parts[2].size() / 2];
  unsigned char salt2[challenge_parts[4].size() / 2];

  for (int i = 0; i < challenge_parts[2].size(); i += 2) {
    sscanf(challenge_parts[2].substr(i, 2).c_str(), "%02x", &salt1[i / 2]);
  }
  for (int i = 0; i < challenge_parts[4].size(); i += 2) {
    sscanf(challenge_parts[4].substr(i, 2).c_str(), "%02x", &salt2[i / 2]);
  }

  // Hash twice, once with static salt...
  unsigned char hash1[SHA256_DIGEST_LENGTH];

  PKCS5_PBKDF2_HMAC(mPassword.c_str(), mPassword.size(), salt1, sizeof(salt1), iter1, EVP_sha256(), SHA256_DIGEST_LENGTH, hash1);
  // Once with dynamic salt.
  unsigned char hash2[SHA256_DIGEST_LENGTH];

  PKCS5_PBKDF2_HMAC((const char*)hash1, sizeof(hash1), salt2, sizeof(salt2), iter2, EVP_sha256(), SHA256_DIGEST_LENGTH, hash2);
  // Convert the hash2 array to a hexadecimal string
  char hash2_hex[SHA256_DIGEST_LENGTH * 2 + 1];
  for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) {
    sprintf(hash2_hex + i * 2, "%02x", hash2[i]);
  }

  return challenge_parts[4] + '$' + hash2_hex;

}
</code>```

ContentLicense: CC BY-SA 4.0

Title: http challenge response POST with curl

Body:
I have written a small c++ program to connect to my router (avm Fritzbox 7590) using a challenge response method.

For this I use openssl (SHA256), curl(GET & POST) and tinyXML (parsing the response).

I have a member function "query_challenge()" to query the FritzBox for a challenge.

This I receive as .xml, this I receive:

<?xml version="1.0" encoding="utf-8"?>
<SessionInfo>
    <SID>0000000000000000</SID>
    <Challenge>2$60000$*******************$6000$15a84421a7dfc4d9ac8026f776de48f3</Challenge>
    <BlockTime>0</BlockTime>
    <Rights/>
    <Users>
        <User last="1">adminxxx</User>
    </Users>
</SessionInfo>

With the member function "std::string calculate_pbkdf2_response()" I evaluate the received challenge and send this "query_sessionID()" with a POST to the FritzBox to log in and get a valid SessionID.

When calling my query_sessionID() method, if everything is correct, I should get another XML via the POST in which a valid SID(SessionID) is contained.

However, I get the following response:

<?xml version="1.0" encoding="utf-8"?>
<SessionInfo>
    <SID>0000000000000000</SID>
    <Challenge>2$60000$diffent*******************$6000$1268d1df004ffdb2fd8074b557467a01</Challenge>
    <BlockTime>128</BlockTime>
    <Rights/>
    <Users>
        <User last="1">adminxxx</User>
    </Users>
</SessionInfo>

which shows that either the calculated resopnse is incorrect or the POST may not have worked correctly.

I tested my calculate_pbkdf2_response() with the example below.

The example challenge “2$10000$5A1711$2000$5A1722” and the password
“1example!“  (utf8-encoded) results in: hash1 =
pbdkf2_hmac_sha256(“1example!”, 5A1711, 10000)
=> 0x23428e9dec39d95ac7a40514062df0f9e94f996e17c398c79898d0403b332d3b (hex) response = 5A1722$ + pbdkf2_hmac_sha256(hash1, 5A1722,
2000).hex()
=> 5A1722$1798a1672bca7c6463d6b245f82b53703b0f50813401b03e4045a5861e689adb
https://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AVM_Technical_Note_-_Session_ID_english_2021-05-03.pdf

This "5A1722$1798a1672bca7c6463d6b245f82b53703b0f50813401b03e4045a5861e689adb" response gets my calculate_pbkdf2_response() method also out with the respective PW and challenge.

So I suspect that my CURL POST request may not be correct.
Maybe someone has a tip who has more experience with this stuff, this is my first http attempt with CURL as well as the first use of openSSL or challenge response method.

main.cpp:

#include <iostream>
#include "../public/FritzBox_Session.hpp"

int main(int argc, char const *argv[])
{
  std::string user = "adminxxx";
  std::string pw = "passwort";
  homeAutomat::FritzBox::FritzBox_Session TEST(user, pw);
  TEST.establish_connection();

  return 0;
}

FritzBox_Session.hpp:

    #include <iostream>
    #include <string>
    #include <sstream>

    #include <curl/curl.h>
    #include <nlohmann/json.hpp>
    #include <tinyxml2.h>
    #include <openssl/evp.h>
    #include <openssl/sha.h>

    namespace homeAutomat {

    namespace FritzBox {

    class FritzBox_Session
    {
    private:

      CURL *curl;
      const std::string fritzbox_addr = "http://fritz.box/login_sid.lua?version=2";

      std::string mUsername;
      std::string mPassword;

      std::stringstream mChallenge;
      std::string mSID;

      tinyxml2::XMLDocument XML_response;

      bool query_challenge();
      bool query_sessionID();

      std::string calculate_pbkdf2_response();

    public:
      FritzBox_Session(std::string &username, std::string &password);
      ~FritzBox_Session();

      bool establish_connection();
    };

    } // FritzBox
    } // homeAutomat

FritzBox_Session.cpp:

    #include "FritzBox_Session.hpp"

using namespace homeAutomat;
using namespace FritzBox;

using namespace nlohmann;

namespace {

// CURL - ReadReceivedData Callback-Fuction
size_t writeFunction(void *ptr, size_t size, size_t nmemb, void *userdata)
{
  ((std::string*)userdata)->append((char*)ptr, size * nmemb);
  return size * nmemb;
}

}

FritzBox_Session::FritzBox_Session(std::string &username, std::string &password)
:
mUsername(username),
mPassword(password)
{
  curl = curl_easy_init();
  if(!curl){
    std::cerr << "curl isn't initialized! " << std::endl;
  }

}

FritzBox_Session::~FritzBox_Session()
{
  curl_easy_cleanup(curl);
}

bool FritzBox_Session::establish_connection()
{
  if(query_challenge()){
    if(query_sessionID()){

    }
    else{
      std::cerr << "error at query_sessionID() occurred" << std::endl;
      return false;
    }
  }
  else{
    std::cerr << "error at query_challenge() occurred" << std::endl;
      return false;
  }
  return true;
}

bool FritzBox_Session::query_challenge()
{
  std::string readBuffer;
  CURLcode retVal;

  if(!curl){
    std::cerr << "curl isn't initialized!'" << std::endl;
    return 1;
  }

  curl_easy_setopt(curl, CURLOPT_URL, fritzbox_addr.c_str());
  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeFunction);
  curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);

  retVal = curl_easy_perform(curl);
  if(retVal != CURLE_OK){
    std::cerr << "curl_easy_perform() failed: " << curl_easy_strerror(retVal) << std::endl;
    return false;
  }

  int error_id = XML_response.Parse(&readBuffer[0]);
  if(error_id != tinyxml2::XML_SUCCESS){
    std::cout << "xml parse error" << XML_response.ErrorName() << std::endl;
    XML_response.Clear();
    return false;
  }

  auto save_xml_to_file = XML_response.SaveFile("response_query_challenge.xml");
  if(save_xml_to_file != tinyxml2::XML_SUCCESS){
    std::cout << "xml save to file error: " << XML_response.ErrorName() << std::endl;
  }

  // search for  <SessionInfo>
  tinyxml2::XMLElement* sessionInfo = XML_response.FirstChildElement("SessionInfo");
  if(sessionInfo == nullptr){
    std::cerr << "XML response has no <SessionInfo>-Variable!" << std::endl;
    XML_response.Clear();
    return false;
  }
  // search for  <SessionInfo> <Challenge> </SessionInfo>
  tinyxml2::XMLElement* challenge = sessionInfo->FirstChildElement("Challenge");
  if(challenge == nullptr){
    std::cerr << "XML response has no <Challenge>-Variable!" << std::endl;
    XML_response.Clear();
    return false;
  }
  // get String Value of <SessionInfo> <Challenge> </SessionInfo>
  mChallenge << challenge->GetText();
  if(mChallenge.str().empty()){
    std::cerr << "XML response <Challenge> is empty!" << std::endl;
    XML_response.Clear();
    return false;
  }

  XML_response.Clear();
  return true;

}

bool FritzBox_Session::query_sessionID()
{
  CURLcode retVal;
  std::string readBuffer;
  std::string response = calculate_pbkdf2_response();

  if (!curl) {
    std::cerr << "Fehler beim Initialisieren von CURL" << std::endl;
    return 1;
  }

  // HTTP Method 'POST'
  curl_easy_setopt(curl, CURLOPT_POST, 1L);

  // Set POST Data
  std::string post_data = "username=" + mUsername + "&response=" + response;
  curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, post_data.length());
  curl_easy_setopt(curl, CURLOPT_POSTFIELDS, &post_data[0]);

  // Set Content-Type-Header
  struct curl_slist* headers = NULL;
  headers = curl_slist_append(headers, "Content-Type: application/x-www-form-urlencoded");
  curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

  // Set Callback to writeFunction() received data
 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writeFunction);
 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);

  // Send POST data and received answer
  retVal = curl_easy_perform(curl);
  if(retVal != CURLE_OK){
    std::cerr << "Error while sending the request: " << curl_easy_strerror(retVal) << std::endl;
    return false;
  }
  else{

    int error_id = XML_response.Parse(&readBuffer[0]);
    if(error_id != tinyxml2::XML_SUCCESS){
      std::cout << "xml parse error" << XML_response.ErrorName() << std::endl;
    }

    auto save_xml_to_file = XML_response.SaveFile("response_query_sessionID.xml");
    if(save_xml_to_file != tinyxml2::XML_SUCCESS){
      std::cout << "xml save to file error: " << XML_response.ErrorName() << std::endl;
    }

    tinyxml2::XMLElement* sessionInfo = XML_response.FirstChildElement("SessionInfo");
    if(sessionInfo == nullptr){
      std::cerr << "XML response has no <SessionInfo>-Variable!" << std::endl;
      XML_response.Clear();
      return false;
    }

    tinyxml2::XMLElement* SID = sessionInfo->FirstChildElement("SID");
    if(SID == nullptr){
      std::cerr << "XML response has no <SID>-Variable!" << std::endl;
      XML_response.Clear();
      return false;
    }

    mSID = SID->GetText();
    if(mSID.empty()){
      std::cerr << "XML response <SID> is empty!" << std::endl;
      XML_response.Clear();
      return false;
    }

    if(mSID.compare("0000000000000000") == 0){
      std::cerr << "username or password wrong!" << std::endl;
    }
    else{
      std::cout << "login was successful SID is: " << mSID << std::endl;
    }

    return true;
  }

}

std::string FritzBox_Session::calculate_pbkdf2_response()
{
  // Split the challenge into parts
  std::vector<std::string> challenge_parts;
  std::string item;
  while (std::getline(mChallenge, item, '$'))
  {
    challenge_parts.push_back(item);
  }

  // Extract all necessary values encoded into the challenge
  int iter1 = std::stoi(challenge_parts[1]);
  int iter2 = std::stoi(challenge_parts[3]);

  // Convert the salt strings to unsigned char arrays
  unsigned char salt1[challenge_parts[2].size() / 2];
  unsigned char salt2[challenge_parts[4].size() / 2];

  for (int i = 0; i < challenge_parts[2].size(); i += 2) {
    sscanf(challenge_parts[2].substr(i, 2).c_str(), "%02x", &salt1[i / 2]);
  }
  for (int i = 0; i < challenge_parts[4].size(); i += 2) {
    sscanf(challenge_parts[4].substr(i, 2).c_str(), "%02x", &salt2[i / 2]);
  }

  // Hash twice, once with static salt...
  unsigned char hash1[SHA256_DIGEST_LENGTH];

  PKCS5_PBKDF2_HMAC(mPassword.c_str(), mPassword.size(), salt1, sizeof(salt1), iter1, EVP_sha256(), SHA256_DIGEST_LENGTH, hash1);
  // Once with dynamic salt.
  unsigned char hash2[SHA256_DIGEST_LENGTH];

  PKCS5_PBKDF2_HMAC((const char*)hash1, sizeof(hash1), salt2, sizeof(salt2), iter2, EVP_sha256(), SHA256_DIGEST_LENGTH, hash2);
  // Convert the hash2 array to a hexadecimal string
  char hash2_hex[SHA256_DIGEST_LENGTH * 2 + 1];
  for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) {
    sprintf(hash2_hex + i * 2, "%02x", hash2[i]);
  }

  return challenge_parts[4] + '$' + hash2_hex;

}


问:
How to do a MVC like a SPA (Single page application)?
I'm trying to create a loader, which loads an animation between visits new paths, something like this:

https://koisquad.com/

The problem is I made my project with following logic (MVC Model View Controller) and I need to not reload the page when the path changes.

I have been investigating and realize that need to use javascript using window.history.pushstate
I tried a lot ways but I can not implement propertly.

Layout page

```<code><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $title; ?></title>
</head>

<body>
    <?php
        include_once __DIR__ . '/templates/loader.php';
    ?>

    echo $content; //ONE EXAMPLE VIEW (events.php)

    <!-- My Javascript -->
    <script src="/build/js/main.min.js" defer></script>

</body>
</html>
</code>```

One example view (/events.php)

```<code><main>
    <div> EVENTS CONTENT </div>
</main>

</code>```

The Controller

```<code> class PublicPagesController {

    //Main page

    public static function index(Router $router) {
       //The Backend logic, Database querys for render later in view...

        $router->render('views/index', [
            'title' => 'Inicio',
        ]);
    }

    //Contact page

    public static function events(Router $router) {
        //The Backend logic, Database querys for render later in view...
        $events = Events::all();

        $router->render('views/events', [
            'title' => 'Contact',
            'events' => $events
        ]);
    }
</code>```

The router:

```<code>public function render($view, $data = [])
{
    foreach ($data as $key => $value) {
        $$key = $value;
    }

    ob_start();

    include_once __DIR__ . "/views/$view.php";

    $content = ob_get_clean(); // THAT IS THE CONTENT THAT SHOWS ON LAYOUT PAGE
}
</code>```

I have the models too, but I think it's irrelevant to the question.

How can I obtain the view and render in the $content without reloading the page? (With JS or Other solutions)

Thank you a lot in advance, sorry if the question is a little dumb I'm trying to improve :(

I tried to use fetch in JS to URLs (Previusly encoded in JSON in php) for try to get the view content and window.history.pushstate but I cant get the view without a reloading.

Body:
I'm trying to create a loader, which loads an animation between visits new paths, something like this:

https://koisquad.com/

The problem is I made my project with following logic (MVC Model View Controller) and I need to not reload the page when the path changes.

I have been investigating and realize that need to use javascript using window.history.pushstate
I tried a lot ways but I can not implement propertly.

Layout page

<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $title; ?></title>

    <?php
        include_once __DIR__ . '/templates/loader.php';
    ?>

    echo $content; //ONE EXAMPLE VIEW (events.php)

One example view (/events.php)

 EVENTS CONTENT

The Controller

 class PublicPagesController {

    //Main page

    public static function index(Router $router) {
       //The Backend logic, Database querys for render later in view...

        $router->render('views/index', [
            'title' => 'Inicio',
        ]);
    }

    //Contact page

    public static function events(Router $router) {
        //The Backend logic, Database querys for render later in view...
        $events = Events::all();

        $router->render('views/events', [
            'title' => 'Contact',
            'events' => $events
        ]);
    }

The router:

public function render($view, $data = [])
{
    foreach ($data as $key => $value) {
        $$key = $value;
    }

    ob_start();

    include_once __DIR__ . "/views/$view.php";

    $content = ob_get_clean(); // THAT IS THE CONTENT THAT SHOWS ON LAYOUT PAGE
}

I have the models too, but I think it's irrelevant to the question.

How can I obtain the view and render in the $content without reloading the page? (With JS or Other solutions)

Thank you a lot in advance, sorry if the question is a little dumb I'm trying to improve :(

I tried to use fetch in JS to URLs (Previusly encoded in JSON in php) for try to get the view content and window.history.pushstate but I cant get the view without a reloading.


问:
SQLite Exception in .NET MAUI
When running a .NET MAUI application, I get an error

System.TypeInitializationException: 'The type initializer for 'SQLite.SQLiteConnection' threw an    exception.'

which is related to SQLite. I don't know how to solve it, I looked at some suggestions to clean and rebuild the application, but I tried that and it was unsuccessful.

Do you have any effective solution? I followed the tutorial on YT through which I did this, on the video everything works but I get an error... I'm in the process of learning .NET MAUI and this is my first time working with a database so I don't know what to do..

Thank you in advance!

I added these NuGet packages to the project:

```<code>  <PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
  <PackageReference Include="sqlite-net-pcl" Version="1.6.292" />
  <PackageReference Include="SQLitePCLRaw.core" Version="2.1.0" />
  <PackageReference Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.0" />
  <PackageReference Include="SQLitePCLRawEx.bundle_green" Version="2.1.0" />
  <PackageReference Include="SQLitePCLRawEx.provider.dynamic_cdecl" Version="2.1.0" />
</code>```

Title: SQLite Exception in .NET MAUI

Body:
When running a .NET MAUI application, I get an error

System.TypeInitializationException: 'The type initializer for 'SQLite.SQLiteConnection' threw an    exception.'

which is related to SQLite. I don't know how to solve it, I looked at some suggestions to clean and rebuild the application, but I tried that and it was unsuccessful.

Do you have any effective solution? I followed the tutorial on YT through which I did this, on the video everything works but I get an error... I'm in the process of learning .NET MAUI and this is my first time working with a database so I don't know what to do..

Thank you in advance!

I added these NuGet packages to the project:

  <PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
  <PackageReference Include="sqlite-net-pcl" Version="1.6.292" />
  <PackageReference Include="SQLitePCLRaw.core" Version="2.1.0" />
  <PackageReference Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.0" />
  <PackageReference Include="SQLitePCLRawEx.bundle_green" Version="2.1.0" />
  <PackageReference Include="SQLitePCLRawEx.provider.dynamic_cdecl" Version="2.1.0" />