2
pysparkのデータフレームでアクセスしてるネストした列:私はこのようなXML文書持つ
df.columns
['Search']
print df.select("Search")
DataFrame[Search: struct<Location:struct<Country:string,Latitude:bigint,Longitude:bigint,Region:string>>]
:私は1列を見ることができます
df = sqlContext.read.format('com.databricks.spark.xml').options(rowTag='Position').load('1.xml')
:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Position>
<Search>
<Location>
<Region>OH</Region>
<Country>us</Country>
<Longitude>-816071</Longitude>
<Latitude>415051</Latitude>
</Location>
</Search>
</Position>
は、私がデータフレームの中にそれを読むを
ネストされた列にはどのようにしてアクセスしますか。 ex Location.Region?
は、あなたが取得するデータフレームのサンプル列を投稿することができます。 –
これは非常に有用でした。 – lakshmi