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 in Python by akhtar
• 32,960 points
21 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 by MD
• 77,700 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
14,520 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
394 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
• 57,700 points
720 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
2,699 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,450 points
265 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,450 points
668 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,450 points
751 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 in Python by MD
• 77,700 points
261 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 in Python by MD
• 77,700 points
106 views