Storing 3 large data sets in one workspace
2 次查看(过去 30 天)
显示 更早的评论
Hello i have 3 data sets from NESO for System Inertia, System Frequency and Historic generation mix and carbon intensity.
They are quite large in size, just wondering how to put into one workspace for data analysis.
1 个评论
Aquatris
2024-10-10
what is the problem you encounter when you try to import all 3 datasets to your workspace?
Unless you have memory limitations, this should not be a problem
回答(1 个)
Aastha
2024-10-11
Hi Mark,
I understand that you are working with three large datasets, and you are looking for a way to load them into the workspace while managing memory constraints.
You can use "datastore" function in MATLAB, which is specifically designed for handling collections of data that are too large to fit into memory.
Kindly refer to the example mentioned below illustrating the use of "datastore" function for large datasets:
1. Configure the datastore function using the MATLAB code given below:
ds = tabularTextDatastore("large_file.csv"); % Create a datastore for tabular text data
ds.SelectedVariableNames = {'Column_Name_1', 'Column_Name_2'}; % Specify columns to be read from the file
ds.TreatAsMissing = 'NA'; % Replace missing data with NA
ds.ReadSize = 15000; % Define the number of rows to be read at once based on memory constraints
2. Use a while loop along with a "hasdata" function to determine if there is data available to read the data from the "datastore" function as shown in the MATLAB code below:
reset(ds); % reset the datastore to the initial state
while hasdata(ds)
T = read(ds); % Read data from the datastore
% Process the intermediate data
% Insert your processing code here
end
This method allows you to handle datasets too large to fit into memory efficiently. Additionally, you can explore other methods for managing large datasets by referring to the link given below:
For more information on the "datastore" and "hasdata" function, kindly refer to the link of MathWorks documentation mentioned below:
-datastore:
-hasdata:
I hope this is helpful!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Datastore 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!