We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1f393c commit d063cbcCopy full SHA for d063cbc
bindings/pyroot/pythonizations/test/rdataframe_makenumpy.py
@@ -154,6 +154,16 @@ def test_sliced_array(self):
154
self.assertEqual(list(x_col.GetValue()), [1,3])
155
self.assertEqual(list(y_col.GetValue()), [2,4])
156
157
+ def test_empty_arrays(self):
158
+ """
159
+ Test creating an RDataFrame from an empty numpy array
160
161
+ data = {"x": np.array([], dtype="object")}
162
+ df = ROOT.RDF.FromNumpy(data)
163
+ colnames = df.GetColumnNames()
164
+ self.assertIn("x", colnames)
165
+ self.assertEqual(df.Count().GetValue(), 0)
166
+
167
168
if __name__ == '__main__':
169
unittest.main()
0 commit comments