Feature Type
-
[X] Adding new functionality to pandas
-
[X] Changing existing functionality in pandas
-
[ ] Removing existing functionality in pandas
Problem Description
The possibility to not only define .Name
after creating the DataFrame as currently exists, but also to be able to add it at the moment of creating the DataFrame as an argument, make unnecessary to use additional lines (especially when using several distinct DataFrames that require defining a .Name
) and provide the convenience of keeping all the creation and definitions in a single execution.
Feature Description
import pandas as pd
df = pd.read_csv('database.csv', Name='Pressure Stats')
Alternative Solutions
Current existing method:
import pandas as pd
df = pd.read_csv('database.csv')
df.Name = 'Pressure Stats'
Additional Context
In fact it is something small, which currently does not affect use or cause any kind of confusion, but it would provide greater convenience and organization, including the visual and informational issue when others see how this Dataframe was created and what was included in it originally .
Comment From: topper-123
Pandas has no explicit support for a Name
attribute specifically, so it won't make sense to add that to read_csv
et.al.
Setting attributes on dataframes manually will technically work, but is that probably a bad practice for all the normal reasons in Python. We recommend setting user created attributes on DataFrame.attrs
instead.
Closing as wontfix.