How to write a HDF file from a DataFrame

0 votes

Hi Guys,

I am new to HDFS Cluster. I want to integrate Pandas with HDFS. Can anyone tell me how to write a HDF file from a DataFrame?

Oct 17, 2020 in Python by akhtar
• 38,180 points
94 views

1 answer to this question.

0 votes

Hi@akhtar,

Hierarchical Data Format (HDF) is a set of file formats (HDF4HDF5) designed to store and organize large amounts of data. You can use the below command to do so.

df = pd.DataFrame([[1, 1.0, 'a']], columns=['x', 'y', 'z'])
df.to_hdf('./store.h5', 'data')
answered Oct 17, 2020 by MD
• 95,220 points

Related Questions In Python

0 votes
2 answers
+1 vote
4 answers

How to write nested dictionaries to a CSV file

Using DictWriter there is no need in ...READ MORE

answered Oct 18, 2018 in Python by Richard William
17,687 views
0 votes
1 answer

How can I write nested dictionaries to a csv file?

You can use the pandas library to ...READ MORE

answered Apr 17, 2018 in Python by anonymous
512 views
0 votes
1 answer

How to Parse values from a JSON file?

import json from pprint import pprint with open('data.json') as ...READ MORE

answered Oct 15, 2018 in Python by Priyaj
• 58,120 points
1,001 views
+1 vote
2 answers

What does hadoop fs -du command gives as output?

du command is used for to see ...READ MORE

answered Jul 23, 2019 in Big Data Hadoop by Lokesh Singh
3,429 views
0 votes
1 answer

How can I write text in HDFS using CMD?

Hadoop put & appendToFile only reads standard ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 13,480 points
397 views
0 votes
1 answer

What is the command to find the free space in HDFS?

You can use dfsadmin which runs a ...READ MORE

answered Apr 29, 2018 in Big Data Hadoop by Shubham
• 13,480 points
878 views
0 votes
1 answer

How to find the used cache in HDFS

hdfs dfsadmin -report This command tells fs ...READ MORE

answered May 4, 2018 in Big Data Hadoop by Shubham
• 13,480 points
982 views
0 votes
1 answer

How to call a function from another file in Python?

Hi@akhtar, You can use the import keyword to ...READ MORE

answered Jun 24, 2020 in Python by MD
• 95,220 points
2,048 views
0 votes
1 answer

How to save a Pandas Dataframe to a pickle file?

Hi@akhtar, Python pickle module is used for serializing ...READ MORE

answered Oct 17, 2020 in Python by MD
• 95,220 points
1,566 views