16
16
from collections import OrderedDict
17
17
from os .path import exists
18
18
19
- import dask
20
19
import dask .dataframe as dd
21
20
import numpy as np
22
21
import pandas as pd
@@ -292,16 +291,16 @@ def parse_gtf_and_expand_attributes(filepath_or_buffer, npartitions=None, compre
292
291
features (set or None): Ignore entries which don't correspond to one of the supplied features
293
292
"""
294
293
if npartitions :
295
- ddf = parse_gtf_dask (filepath_or_buffer , npartitions = npartitions , compression = compression , features = features )
296
- ddf = ddf .reset_index (drop = False )
297
- ddf = ddf .set_index ("index" )
294
+ df = parse_gtf_dask (filepath_or_buffer , npartitions = npartitions , compression = compression , features = features )
295
+ df = df .reset_index (drop = False )
296
+ df = df .set_index ("index" )
298
297
299
- attribute_values = ddf .pop ("attribute" )
298
+ attribute_values = df .pop ("attribute" )
300
299
301
300
for column_name , values in expand_attribute_strings (attribute_values ,
302
301
usecols = restrict_attribute_columns ).items ():
303
302
series = dd .from_array (np .array (values , dtype = np .str ))
304
- ddf [column_name ] = series
303
+ df [column_name ] = series
305
304
else :
306
305
df = parse_gtf (filepath_or_buffer , chunksize = chunksize , features = features )
307
306
@@ -311,7 +310,7 @@ def parse_gtf_and_expand_attributes(filepath_or_buffer, npartitions=None, compre
311
310
usecols = restrict_attribute_columns ).items ():
312
311
df [column_name ] = values
313
312
314
- return ddf
313
+ return df
315
314
316
315
317
316
def read_gtf (filepath_or_buffer , npartitions = None , compression = None , expand_attribute_column = True ,
0 commit comments