@@ -1190,20 +1190,20 @@ def compile_values(
1190
1190
1191
1191
Parameters
1192
1192
-----------
1193
- value_call
1194
- Function to call on each record to extract the desired value. Must return a scalar value or
1193
+ value_call
1194
+ Function to call on each record to extract the desired value. Must return a scalar value or
1195
1195
a sequence of values if 'unpack' is set to True.
1196
1196
1197
1197
value_names
1198
- Column name(s) for the extracted value(s). If a string is provided and multiple values are
1199
- returned by 'value_call', columns are named by appending an index to this string. If a list
1198
+ Column name(s) for the extracted value(s). If a string is provided and multiple values are
1199
+ returned by 'value_call', columns are named by appending an index to this string. If a list
1200
1200
of strings is provided, it must match the length of the sequence returned by 'value_call'.
1201
1201
Default is "value".
1202
1202
1203
- entry_names
1203
+ entry_names
1204
1204
Entry names to filter records. If not provided, considers all entries.
1205
1205
1206
- specification_names
1206
+ specification_names
1207
1207
Specification names to filter records. If not provided, considers all specifications.
1208
1208
1209
1209
unpack
@@ -1226,11 +1226,11 @@ def compile_values(
1226
1226
Notes
1227
1227
------
1228
1228
1. The DataFrame is structured such that the rows are entries and columns are specifications.
1229
- 2. If 'unpack' is True, the function assumes 'value_call' returns a sequence of values that need
1229
+ 2. If 'unpack' is True, the function assumes 'value_call' returns a sequence of values that need
1230
1230
to be distributed across columns in the resulting DataFrame. 'value_call' should always return the
1231
1231
same number of values for each record if unpack is True.
1232
1232
"""
1233
-
1233
+
1234
1234
def _data_generator (unpack = False ):
1235
1235
for entry_name , spec_name , record in self .iterate_records (
1236
1236
entry_names = entry_names ,
@@ -1279,13 +1279,13 @@ def get_properties_df(self, properties_list: Sequence[str]) -> pd.DataFrame:
1279
1279
1280
1280
This function uses the provided list of property names to extract corresponding
1281
1281
values from each record's properties. It returns a DataFrame where rows represent
1282
- each record. Each column corresponds has a top level index as a specification,
1283
- and a second level index as the appropriate value name. Columns with all
1282
+ each record. Each column corresponds has a top level index as a specification,
1283
+ and a second level index as the appropriate value name. Columns with all
1284
1284
NaN values are dropped.
1285
1285
1286
1286
Parameters:
1287
1287
-----------
1288
- properties_list
1288
+ properties_list
1289
1289
List of property names to retrieve from the records.
1290
1290
1291
1291
Returns:
0 commit comments